Spaces:
Sleeping
Sleeping
[UPDATE] => changing the layout to singe input text that is then translated by the two selected models
Browse files
app.py
CHANGED
@@ -51,23 +51,18 @@ def translate_fine_tuned(text, model):
|
|
51 |
|
52 |
# Create Gradio interface
|
53 |
with gr.Blocks() as demo:
|
54 |
-
gr.Markdown("# Translation Models")
|
55 |
-
|
56 |
with gr.Row():
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
fine_tuned_input = gr.Textbox(placeholder="Enter text to translate", label="Input")
|
67 |
-
model_select = gr.Dropdown(choices=["S model", "M model", "L model"], label="Select Model")
|
68 |
-
fine_tuned_output = gr.Textbox(label="Translation")
|
69 |
-
fine_tuned_translate_btn = gr.Button("Translate")
|
70 |
-
fine_tuned_translate_btn.click(translate_fine_tuned, inputs=[fine_tuned_input, model_select], outputs=fine_tuned_output)
|
71 |
|
72 |
port = int(os.getenv("GRADIO_SERVER_PORT", "7861"))
|
73 |
demo.launch(server_port=port)
|
|
|
51 |
|
52 |
# Create Gradio interface
|
53 |
with gr.Blocks() as demo:
|
54 |
+
gr.Markdown("# Translation Models\nTranslate text using base and fine-tuned models.")
|
55 |
+
|
56 |
with gr.Row():
|
57 |
+
text_input = gr.Textbox(placeholder="Enter text to translate", label="Input", placeholder="If you have behaved badly, repent, make what amends you can and address yourself to the task of behaving better next time. On no account brood over your wrongdoing. Rolling in the muck is not the best way of getting clean.")
|
58 |
+
model_select = gr.Dropdown(choices=["S model", "M model", "L model"], label="Select Fine-tuned Model")
|
59 |
+
translate_btn = gr.Button("Translate")
|
60 |
+
|
61 |
+
with gr.Row():
|
62 |
+
base_output = gr.Textbox(label="Base Model Translation")
|
63 |
+
fine_tuned_output = gr.Textbox(label="Fine-tuned Model Translation")
|
64 |
+
|
65 |
+
translate_btn.click(translate_text, inputs=[text_input, model_select], outputs=[base_output, fine_tuned_output])
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
port = int(os.getenv("GRADIO_SERVER_PORT", "7861"))
|
68 |
demo.launch(server_port=port)
|