lodhrangpt commited on
Commit
a7cc277
1 Parent(s): 75463a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -34,19 +34,23 @@ languages = {
34
  }
35
 
36
 
37
- # Set up the Gradio interface with a submit button
38
  with gr.Blocks() as iface:
39
  gr.Markdown("# Text Translator")
40
  gr.Markdown("Translate text into multiple languages using Hugging Face models.")
41
 
42
- # Input components
43
- text_input = gr.Textbox(label="Enter text to translate")
44
- language_dropdown = gr.Dropdown(list(languages.keys()), label="Target Language", type="value")
 
 
 
45
 
46
- # Output component
47
- translation_output = gr.Textbox(label="Translation")
 
48
 
49
- # Button to submit
50
  submit_button = gr.Button("Translate")
51
 
52
  # When button is clicked, trigger the translation
 
34
  }
35
 
36
 
37
+ # Set up the Gradio interface with a submit button and side-by-side layout
38
  with gr.Blocks() as iface:
39
  gr.Markdown("# Text Translator")
40
  gr.Markdown("Translate text into multiple languages using Hugging Face models.")
41
 
42
+ # Create a row for input and output
43
+ with gr.Row():
44
+ # Input components on the left
45
+ with gr.Column(scale=1): # This column is smaller
46
+ text_input = gr.Textbox(label="Enter text to translate")
47
+ language_dropdown = gr.Dropdown(list(languages.keys()), label="Target Language", type="value")
48
 
49
+ # Output components on the right
50
+ with gr.Column(scale=1): # This column is also smaller
51
+ translation_output = gr.Textbox(label="Translation", interactive=False)
52
 
53
+ # Button to submit the translation
54
  submit_button = gr.Button("Translate")
55
 
56
  # When button is clicked, trigger the translation