Hyeonseo commited on
Commit
b8d88fa
β€’
1 Parent(s): e716c34

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -8
app.py CHANGED
@@ -1,15 +1,24 @@
1
  import gradio as gr
2
 
3
- def translate(text):
4
- return "translate_function"
 
 
 
 
 
 
 
 
 
5
 
6
  prompt_translate = gr.Interface(
7
- fn=translate,
8
- inputs=gr.inputs.Textbox(lines=10, label="Input Text"),
9
- outputs=gr.outputs.Textbox(label="Translation"),
10
- title="ScienceBrief Translation",
11
- description="Translate your text into French using the ScienceBrief translation model.",
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()