Spaces:
Sleeping
Sleeping
fix: remove deprecated `gr.inputs/outputs`
Browse files
app.py
CHANGED
|
@@ -148,14 +148,13 @@ def translate_openai(language: str, filepath: str, api_key: str) -> list[str]:
|
|
| 148 |
|
| 149 |
demo = gr.Blocks()
|
| 150 |
|
| 151 |
-
outputs = gr.outputs.Textbox(label="Translation")
|
| 152 |
with demo:
|
| 153 |
gr.Markdown(
|
| 154 |
"# HuggingFace i18n made easy\n"
|
| 155 |
'<img style="float: right;" src="hfkr_logo.png" height="10em">'
|
| 156 |
)
|
| 157 |
with gr.Row():
|
| 158 |
-
language_input = gr.
|
| 159 |
default="Korean",
|
| 160 |
label=" / ".join([
|
| 161 |
"Target language", "langue cible",
|
|
@@ -163,7 +162,7 @@ with demo:
|
|
| 163 |
"도착어", "língua alvo"
|
| 164 |
])
|
| 165 |
)
|
| 166 |
-
filepath_input = gr.
|
| 167 |
default="tasks/masked_language_modeling.md",
|
| 168 |
label="File path of transformers document"
|
| 169 |
)
|
|
@@ -175,11 +174,11 @@ with demo:
|
|
| 175 |
prompt_output = gr.Textbox(label="Full Prompt", lines=3).style(show_copy_button=True)
|
| 176 |
# TODO: add check for segments, indicating whether user should add or remove new lines from their input. (gr.Row)
|
| 177 |
gr.Markdown("2. After getting the complete translation, remove randomly inserted newlines on your favorite text editor and paste the result below.")
|
| 178 |
-
ui_translated_input = gr.
|
| 179 |
fill_button = gr.Button("Fill in scaffold", variant="primary")
|
| 180 |
with gr.TabItem("API (Not Implemented)"):
|
| 181 |
with gr.Row():
|
| 182 |
-
api_key_input = gr.
|
| 183 |
api_call_button = gr.Button("Translate (Call API)", variant="primary")
|
| 184 |
with gr.Row():
|
| 185 |
content_output = gr.Textbox(label="Original content").style(show_copy_button=True)
|
|
|
|
| 148 |
|
| 149 |
demo = gr.Blocks()
|
| 150 |
|
|
|
|
| 151 |
with demo:
|
| 152 |
gr.Markdown(
|
| 153 |
"# HuggingFace i18n made easy\n"
|
| 154 |
'<img style="float: right;" src="hfkr_logo.png" height="10em">'
|
| 155 |
)
|
| 156 |
with gr.Row():
|
| 157 |
+
language_input = gr.Textbox(
|
| 158 |
default="Korean",
|
| 159 |
label=" / ".join([
|
| 160 |
"Target language", "langue cible",
|
|
|
|
| 162 |
"도착어", "língua alvo"
|
| 163 |
])
|
| 164 |
)
|
| 165 |
+
filepath_input = gr.Textbox(
|
| 166 |
default="tasks/masked_language_modeling.md",
|
| 167 |
label="File path of transformers document"
|
| 168 |
)
|
|
|
|
| 174 |
prompt_output = gr.Textbox(label="Full Prompt", lines=3).style(show_copy_button=True)
|
| 175 |
# TODO: add check for segments, indicating whether user should add or remove new lines from their input. (gr.Row)
|
| 176 |
gr.Markdown("2. After getting the complete translation, remove randomly inserted newlines on your favorite text editor and paste the result below.")
|
| 177 |
+
ui_translated_input = gr.Textbox(label="Cleaned ChatGPT initial translation")
|
| 178 |
fill_button = gr.Button("Fill in scaffold", variant="primary")
|
| 179 |
with gr.TabItem("API (Not Implemented)"):
|
| 180 |
with gr.Row():
|
| 181 |
+
api_key_input = gr.Textbox(label="Your OpenAI API Key")
|
| 182 |
api_call_button = gr.Button("Translate (Call API)", variant="primary")
|
| 183 |
with gr.Row():
|
| 184 |
content_output = gr.Textbox(label="Original content").style(show_copy_button=True)
|