Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,24 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
prompt_translate = gr.Interface(
|
7 |
-
fn=
|
8 |
-
inputs=
|
9 |
-
outputs=
|
10 |
-
title="
|
11 |
-
description="Translate your text into
|
12 |
theme="compact"
|
13 |
)
|
14 |
|
15 |
-
prompt_translate.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
inputs = [
|
4 |
+
gr.inputs.File(label="Upload MDX File")
|
5 |
+
]
|
6 |
+
|
7 |
+
outputs = gr.outputs.Textbox(label="Translation")
|
8 |
+
|
9 |
+
def translate_with_upload(text, file):
|
10 |
+
if file is not None:
|
11 |
+
# νμΌ μ
λ‘λ μ νμΌ λ΄μ©μ μ½μ΄μ΅λλ€.
|
12 |
+
text = file.read().decode('utf-8')
|
13 |
+
return translate(text)
|
14 |
|
15 |
prompt_translate = gr.Interface(
|
16 |
+
fn=translate_with_upload,
|
17 |
+
inputs=inputs,
|
18 |
+
outputs=outputs,
|
19 |
+
title="ChatGPT Korean Prompt Translation",
|
20 |
+
description="Translate your text into Korean using the GPT-3 model.",
|
21 |
theme="compact"
|
22 |
)
|
23 |
|
24 |
+
prompt_translate.launch()
|