Spaces:
Runtime error
Runtime error
ryanrwatkins
commited on
Commit
Β·
97bd1ab
1
Parent(s):
a7325ef
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import openai
|
|
3 |
import requests
|
4 |
import csv
|
5 |
|
6 |
-
prompt_templates = {"All Needs Gurus": ""}
|
7 |
|
8 |
def get_empty_state():
|
9 |
return {"total_tokens": 0, "messages": []}
|
@@ -28,8 +28,8 @@ def download_prompt_templates():
|
|
28 |
choices = choices[:1] + sorted(choices[1:])
|
29 |
return gr.update(value=choices[0], choices=choices)
|
30 |
|
31 |
-
def on_token_change(user_token):
|
32 |
-
openai.api_key = user_token
|
33 |
|
34 |
def on_prompt_template_change(prompt_template):
|
35 |
if not isinstance(prompt_template, str): return
|
@@ -98,15 +98,15 @@ with gr.Blocks(css=css) as demo:
|
|
98 |
|
99 |
|
100 |
with gr.Column(elem_id="col-container"):
|
101 |
-
gr.Markdown("""
|
102 |
-
|
103 |
Ask questions of all of them, or pick your guru.""",
|
104 |
elem_id="header")
|
105 |
|
106 |
with gr.Row():
|
107 |
with gr.Column():
|
108 |
chatbot = gr.Chatbot(elem_id="chatbox")
|
109 |
-
input_message = gr.Textbox(show_label=False, placeholder="Enter needs assessment question and press enter", visible=True).style(container=False)
|
110 |
btn_submit = gr.Button("Submit")
|
111 |
total_tokens_str = gr.Markdown(elem_id="total_tokens_str")
|
112 |
btn_clear_conversation = gr.Button("π Start New Conversation")
|
|
|
3 |
import requests
|
4 |
import csv
|
5 |
|
6 |
+
prompt_templates = {"All Needs Gurus": "Respond as a needs assessment expert."}
|
7 |
|
8 |
def get_empty_state():
|
9 |
return {"total_tokens": 0, "messages": []}
|
|
|
28 |
choices = choices[:1] + sorted(choices[1:])
|
29 |
return gr.update(value=choices[0], choices=choices)
|
30 |
|
31 |
+
#def on_token_change(user_token):
|
32 |
+
# openai.api_key = user_token
|
33 |
|
34 |
def on_prompt_template_change(prompt_template):
|
35 |
if not isinstance(prompt_template, str): return
|
|
|
98 |
|
99 |
|
100 |
with gr.Column(elem_id="col-container"):
|
101 |
+
gr.Markdown("""# Chat with Needs Assessment Gurus (Past and Present)
|
102 |
+
Ask questions of experts on needs assessments, get responses from *needs assessment* version of ChatGPT.
|
103 |
Ask questions of all of them, or pick your guru.""",
|
104 |
elem_id="header")
|
105 |
|
106 |
with gr.Row():
|
107 |
with gr.Column():
|
108 |
chatbot = gr.Chatbot(elem_id="chatbox")
|
109 |
+
input_message = gr.Textbox(show_label=False, placeholder="Enter your needs assessment question and press enter", visible=True).style(container=False)
|
110 |
btn_submit = gr.Button("Submit")
|
111 |
total_tokens_str = gr.Markdown(elem_id="total_tokens_str")
|
112 |
btn_clear_conversation = gr.Button("π Start New Conversation")
|