Spaces:
Build error
Build error
Commit
·
cef65f9
1
Parent(s):
15a9e9e
Update app.py
Browse files
app.py
CHANGED
@@ -75,7 +75,6 @@ def get_instructor_prompt(fileobj):
|
|
75 |
def embed_prompt(instructor_prompt):
|
76 |
os.environ["SECRET_PROMPT"] = instructor_prompt
|
77 |
return os.environ.get("SECRET_PROMPT")
|
78 |
-
|
79 |
|
80 |
### User Interfaces ###
|
81 |
with gr.Blocks() as demo:
|
@@ -137,7 +136,6 @@ with gr.Blocks() as demo:
|
|
137 |
with gr.Tab("Instructor Only"):
|
138 |
# API Authentication functionality
|
139 |
# Instead of ask students to provide key, the key is now provided by the instructor
|
140 |
-
|
141 |
"""
|
142 |
To permanently set the key, go to Settings -> Variables and secrets -> Secrets,
|
143 |
then replace OPENAI_API_KEY value with whatever openai key of the instructor.
|
@@ -161,7 +159,7 @@ with gr.Blocks() as demo:
|
|
161 |
# Set the secret prompt in this session and embed it to the study tutor
|
162 |
prompt_submit_btn = gr.Button("Submit")
|
163 |
prompt_submit_btn.click(
|
164 |
-
fn=embed_prompt, inputs=instructor_prompt, outputs=test_secret
|
165 |
).then(
|
166 |
fn=create_prompt_store,
|
167 |
inputs=[study_tutor, prompt_submit_btn, file_input, api_input],
|
|
|
75 |
def embed_prompt(instructor_prompt):
|
76 |
os.environ["SECRET_PROMPT"] = instructor_prompt
|
77 |
return os.environ.get("SECRET_PROMPT")
|
|
|
78 |
|
79 |
### User Interfaces ###
|
80 |
with gr.Blocks() as demo:
|
|
|
136 |
with gr.Tab("Instructor Only"):
|
137 |
# API Authentication functionality
|
138 |
# Instead of ask students to provide key, the key is now provided by the instructor
|
|
|
139 |
"""
|
140 |
To permanently set the key, go to Settings -> Variables and secrets -> Secrets,
|
141 |
then replace OPENAI_API_KEY value with whatever openai key of the instructor.
|
|
|
159 |
# Set the secret prompt in this session and embed it to the study tutor
|
160 |
prompt_submit_btn = gr.Button("Submit")
|
161 |
prompt_submit_btn.click(
|
162 |
+
fn=embed_prompt, inputs=[instructor_prompt], outputs=[test_secret]
|
163 |
).then(
|
164 |
fn=create_prompt_store,
|
165 |
inputs=[study_tutor, prompt_submit_btn, file_input, api_input],
|