Spaces:
Build error
Build error
Commit
·
bf8aa3e
1
Parent(s):
69dbc2c
Update app.py
Browse files
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 |
-
|
101 |
-
gr.Textbox(
|
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)
|