brunhild217 commited on
Commit
bf8aa3e
·
1 Parent(s): 69dbc2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -41,7 +41,7 @@ def get_instructor_prompt(fileobj):
41
  file_path = fileobj.name
42
  f = open(file_path, "r")
43
  instructor_prompt = f.read()
44
- return instructor_prompt
45
 
46
 
47
  with gr.Blocks() as demo:
@@ -97,8 +97,8 @@ with gr.Blocks() as demo:
97
  file_input = gr.File(label="Load a .txt or .py file",
98
  file_types=['.py', '.txt'], type="file",
99
  elem_classes="short-height")
100
- #instructor_prompt = file_input.name
101
- gr.Textbox(value=file_input)
102
 
103
 
104
  demo.queue().launch(server_name='0.0.0.0', server_port=7860)
 
41
  file_path = fileobj.name
42
  f = open(file_path, "r")
43
  instructor_prompt = f.read()
44
+ return str(instructor_prompt)
45
 
46
 
47
  with gr.Blocks() as demo:
 
97
  file_input = gr.File(label="Load a .txt or .py file",
98
  file_types=['.py', '.txt'], type="file",
99
  elem_classes="short-height")
100
+ file_input.upload(get_instructor_prompt, inputs="file", outputs=instructor_prompt)
101
+ instructor_prompt = gr.Textbox()
102
 
103
 
104
  demo.queue().launch(server_name='0.0.0.0', server_port=7860)