Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -513,7 +513,7 @@ logging.basicConfig(level=logging.INFO, filename='translation.log', filemode='a'
|
|
| 513 |
format='%(asctime)s - %(levelname)s - %(message)s')
|
| 514 |
|
| 515 |
# Main function to handle the translation workflow
|
| 516 |
-
def main(
|
| 517 |
try:
|
| 518 |
# Login to Hugging Face
|
| 519 |
token = login()
|
|
@@ -586,11 +586,10 @@ with gr.Blocks() as demo:
|
|
| 586 |
|
| 587 |
with gr.Row(equal_height=False):
|
| 588 |
with gr.Column():
|
| 589 |
-
model_id = gr.Textbox(label="Model ID or URL", lines=1)
|
| 590 |
dataset_url = gr.Textbox(label="Dataset URL", lines=1)
|
| 591 |
model_type = gr.Dropdown(choices=["mix", "orpo", "ufb"], label="Model Type")
|
| 592 |
output_dataset_name = gr.Textbox(label="Output Dataset Name", lines=1)
|
| 593 |
-
range_specification = gr.Textbox(label="Range Specification", lines=1, placeholder="e.g., 1-100
|
| 594 |
login_button = gr.Button("Login to Hugging Face")
|
| 595 |
|
| 596 |
with gr.Column():
|
|
@@ -598,6 +597,6 @@ with gr.Blocks() as demo:
|
|
| 598 |
logout_button = gr.Button("Logout")
|
| 599 |
|
| 600 |
submit_btn = gr.Button("Translate Dataset", variant="primary")
|
| 601 |
-
submit_btn.click(main, inputs=[
|
| 602 |
|
| 603 |
demo.launch()
|
|
|
|
| 513 |
format='%(asctime)s - %(levelname)s - %(message)s')
|
| 514 |
|
| 515 |
# Main function to handle the translation workflow
|
| 516 |
+
def main(dataset_url, model_type, output_dataset_name, range_specification):
|
| 517 |
try:
|
| 518 |
# Login to Hugging Face
|
| 519 |
token = login()
|
|
|
|
| 586 |
|
| 587 |
with gr.Row(equal_height=False):
|
| 588 |
with gr.Column():
|
|
|
|
| 589 |
dataset_url = gr.Textbox(label="Dataset URL", lines=1)
|
| 590 |
model_type = gr.Dropdown(choices=["mix", "orpo", "ufb"], label="Model Type")
|
| 591 |
output_dataset_name = gr.Textbox(label="Output Dataset Name", lines=1)
|
| 592 |
+
range_specification = gr.Textbox(label="Range Specification", lines=1, placeholder="e.g., 1-100")
|
| 593 |
login_button = gr.Button("Login to Hugging Face")
|
| 594 |
|
| 595 |
with gr.Column():
|
|
|
|
| 597 |
logout_button = gr.Button("Logout")
|
| 598 |
|
| 599 |
submit_btn = gr.Button("Translate Dataset", variant="primary")
|
| 600 |
+
submit_btn.click(main, inputs=[dataset_url, model_type, output_dataset_name, range_specification], outputs=output)
|
| 601 |
|
| 602 |
demo.launch()
|