Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -125,36 +125,20 @@ def voice_pipeline(audio, target_code):
|
|
125 |
voice_tab = gr.Interface(
|
126 |
fn=voice_pipeline,
|
127 |
inputs=[
|
128 |
-
gr.Audio(source="microphone", type="filepath", label="ποΈ Speak
|
129 |
-
gr.Dropdown(lang_options, value="san_Deva", label="π Target Language")
|
130 |
-
],
|
131 |
-
outputs=[
|
132 |
-
gr.Textbox(label="π§ Transcribed Text"),
|
133 |
-
gr.Textbox(label="π Detected Language"),
|
134 |
-
gr.Textbox(label="π Translated Output"),
|
135 |
-
gr.Textbox(label="π§ Semantic Matches")
|
136 |
-
],
|
137 |
-
title="π€ Voice Translator + Semantic Search"
|
138 |
-
)
|
139 |
-
|
140 |
-
# Text Input Interface (already in your code)
|
141 |
-
text_tab = gr.Interface(
|
142 |
-
fn=text_pipeline, # This should be defined earlier
|
143 |
-
inputs=[
|
144 |
-
gr.Textbox(label="π Enter Text"),
|
145 |
gr.Dropdown(lang_options, value="san_Deva", label="π Target Language"),
|
146 |
-
gr.Textbox(label="Reference Translation (optional for BLEU)")
|
147 |
],
|
148 |
outputs=[
|
149 |
-
gr.Textbox(label="
|
150 |
-
gr.Textbox(label="
|
|
|
151 |
gr.Textbox(label="π§ Semantic Matches"),
|
152 |
-
|
153 |
-
gr.Image(label="π Similarity Chart"),
|
154 |
-
gr.File(label="π₯ Download CSV")
|
155 |
-
],
|
156 |
-
title="π Text Translator + Semantic Search"
|
157 |
)
|
158 |
|
|
|
159 |
# Tabs
|
160 |
-
gr.TabbedInterface(
|
|
|
|
|
|
|
|
125 |
voice_tab = gr.Interface(
|
126 |
fn=voice_pipeline,
|
127 |
inputs=[
|
128 |
+
gr.Audio(source="microphone", type="filepath", label="ποΈ Speak Something"),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
gr.Dropdown(lang_options, value="san_Deva", label="π Target Language"),
|
|
|
130 |
],
|
131 |
outputs=[
|
132 |
+
gr.Textbox(label="π Detected Text"),
|
133 |
+
gr.Textbox(label="π Detected Language"),
|
134 |
+
gr.Textbox(label="π£οΈ Translated Output"),
|
135 |
gr.Textbox(label="π§ Semantic Matches"),
|
136 |
+
]
|
|
|
|
|
|
|
|
|
137 |
)
|
138 |
|
139 |
+
|
140 |
# Tabs
|
141 |
+
gr.TabbedInterface(
|
142 |
+
[voice_tab, text_tab],
|
143 |
+
["π€ Voice Input", "π Text Input"]
|
144 |
+
).launch()
|