Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -72,9 +72,9 @@ def transcribe_audio(audio_file, destination_language):
|
|
72 |
# Gradio interface
|
73 |
with gr.Blocks(css="""
|
74 |
body {
|
75 |
-
background:
|
76 |
font-family: 'Roboto', sans-serif; /* Modern font for readability */
|
77 |
-
color: #
|
78 |
display: flex;
|
79 |
justify-content: center;
|
80 |
align-items: center;
|
@@ -83,7 +83,7 @@ body {
|
|
83 |
padding: 0;
|
84 |
}
|
85 |
h1, h2, h3, label {
|
86 |
-
color: #
|
87 |
text-align: center;
|
88 |
}
|
89 |
button {
|
@@ -147,32 +147,30 @@ input:focus, textarea:focus, select:focus {
|
|
147 |
|
148 |
with gr.Tabs():
|
149 |
with gr.Tab("Text Translation"):
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
translate_button = gr.Button("Translate")
|
157 |
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
|
162 |
with gr.Tab("Audio Translation"):
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
audio_translate_button = gr.Button("Transcribe & Translate")
|
170 |
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
|
177 |
if __name__ == "__main__":
|
178 |
demo.launch()
|
|
|
72 |
# Gradio interface
|
73 |
with gr.Blocks(css="""
|
74 |
body {
|
75 |
+
background: #f0f0f0; /* Light gray background */
|
76 |
font-family: 'Roboto', sans-serif; /* Modern font for readability */
|
77 |
+
color: #333333; /* Dark text color for better readability */
|
78 |
display: flex;
|
79 |
justify-content: center;
|
80 |
align-items: center;
|
|
|
83 |
padding: 0;
|
84 |
}
|
85 |
h1, h2, h3, label {
|
86 |
+
color: #333333; /* Ensure headings and labels are visible */
|
87 |
text-align: center;
|
88 |
}
|
89 |
button {
|
|
|
147 |
|
148 |
with gr.Tabs():
|
149 |
with gr.Tab("Text Translation"):
|
150 |
+
text_input = gr.Textbox(label="Input Text", lines=6, placeholder="Enter your text here...")
|
151 |
+
language_dropdown = gr.Dropdown(
|
152 |
+
choices=available_languages, label="Select Destination Language"
|
153 |
+
)
|
154 |
+
translated_text_output = gr.Textbox(label="Translated Text", lines=4)
|
155 |
+
translate_button = gr.Button("Translate")
|
|
|
156 |
|
157 |
+
translate_button.click(
|
158 |
+
translate_text, inputs=[text_input, language_dropdown], outputs=[translated_text_output]
|
159 |
+
)
|
160 |
|
161 |
with gr.Tab("Audio Translation"):
|
162 |
+
audio_input = gr.Audio(label="Upload Audio File", type="filepath")
|
163 |
+
audio_language_dropdown = gr.Dropdown(
|
164 |
+
choices=available_languages, label="Select Destination Language"
|
165 |
+
)
|
166 |
+
audio_translated_text_output = gr.Textbox(label="Transcribed and Translated Text", lines=4)
|
167 |
+
audio_translate_button = gr.Button("Transcribe and Translate")
|
|
|
168 |
|
169 |
+
audio_translate_button.click(
|
170 |
+
transcribe_audio,
|
171 |
+
inputs=[audio_input, audio_language_dropdown],
|
172 |
+
outputs=[audio_translated_text_output],
|
173 |
+
)
|
174 |
|
175 |
if __name__ == "__main__":
|
176 |
demo.launch()
|