brunhild217 commited on
Commit
1e727da
Β·
1 Parent(s): b90e510

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -137,6 +137,7 @@ 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
  with gr.Box():
141
  gr.Markdown("### OpenAI API Key ")
142
  gr.HTML("""<span>Embed your OpenAI API key below; if you haven't created one already, visit
@@ -147,14 +148,15 @@ with gr.Blocks() as demo:
147
  placeholder="●●●●●●●●●●●●●●●●●", value='')
148
  api_input.submit(fn=embed_key, inputs=[api_input, study_tutor], outputs=study_tutor)
149
  api_input.blur(fn=embed_key, inputs=[api_input, study_tutor], outputs=study_tutor)
150
-
151
- """
152
- Another way to permanently set the key is to directly go to
153
- Settings -> Variables and secrets -> Secrets
154
- Then replace OPENAI_API_KEY value with whatever openai key of the instructor.
155
- """
156
- # api_input = os.environ.get("OPENAI_API_KEY")
157
- # embed_key(api_input, study_tutor)
 
158
 
159
  # Upload secret prompt functionality
160
  # The instructor will provide a secret prompt/persona to the tutor
 
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
  with gr.Box():
142
  gr.Markdown("### OpenAI API Key ")
143
  gr.HTML("""<span>Embed your OpenAI API key below; if you haven't created one already, visit
 
148
  placeholder="●●●●●●●●●●●●●●●●●", value='')
149
  api_input.submit(fn=embed_key, inputs=[api_input, study_tutor], outputs=study_tutor)
150
  api_input.blur(fn=embed_key, inputs=[api_input, study_tutor], outputs=study_tutor)
151
+ """
152
+
153
+ """
154
+ Another way to permanently set the key is to directly go to
155
+ Settings -> Variables and secrets -> Secrets
156
+ Then replace OPENAI_API_KEY value with whatever openai key of the instructor.
157
+ """
158
+ api_input = os.environ.get("OPENAI_API_KEY")
159
+ study_tutor = embed_key(api_input, study_tutor)
160
 
161
  # Upload secret prompt functionality
162
  # The instructor will provide a secret prompt/persona to the tutor