DheivaCodes commited on
Commit
3be937a
Β·
verified Β·
1 Parent(s): dd9e5e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -26
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 Input"),
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="🌐 Translated Output"),
150
- gr.Textbox(label="πŸ” Detected Language"),
 
151
  gr.Textbox(label="🧠 Semantic Matches"),
152
- gr.Number(label="πŸ“Š BLEU Score"),
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([voice_tab, text_tab], ["🎀 Voice Input", "πŸ“ Text Input"]).launch()
 
 
 
 
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()