Hyeonseo commited on
Commit
35932c4
1 Parent(s): 93a8025

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -3,7 +3,7 @@ import subprocess
3
  import openai
4
  import time
5
  import re
6
- '''
7
  def translate(text_input, openapi_key):
8
  openai.api_key = openapi_key
9
 
@@ -32,10 +32,10 @@ def translate(text_input, openapi_key):
32
  time.sleep(20)
33
 
34
  return reply
35
- '''
36
  inputs = [
37
  gr.inputs.Textbox(lines=2, label="Input Open API Key"),
38
- gr.inputs.File(label="Upload MDX File")
39
  ]
40
 
41
  outputs = gr.outputs.Textbox(label="Translation")
@@ -57,8 +57,7 @@ def translate_with_upload(text, file):
57
  else:
58
  text_input = ""
59
 
60
- return ""
61
- # return translate(text_input, openapi_key)
62
 
63
  prompt_translate = gr.Interface(
64
  fn=translate_with_upload,
 
3
  import openai
4
  import time
5
  import re
6
+
7
  def translate(text_input, openapi_key):
8
  openai.api_key = openapi_key
9
 
 
32
  time.sleep(20)
33
 
34
  return reply
35
+
36
  inputs = [
37
  gr.inputs.Textbox(lines=2, label="Input Open API Key"),
38
+ # gr.inputs.File(label="Upload MDX File")
39
  ]
40
 
41
  outputs = gr.outputs.Textbox(label="Translation")
 
57
  else:
58
  text_input = ""
59
 
60
+ return translate(text_input, openapi_key)
 
61
 
62
  prompt_translate = gr.Interface(
63
  fn=translate_with_upload,