Spaces:
Running
Running
Commit
·
6776809
1
Parent(s):
1f95516
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ import faiss
|
|
8 |
|
9 |
|
10 |
openai.api_key = os.environ['openai_key']
|
11 |
-
|
12 |
|
13 |
prompt_templates = {"All Needs Gurus": "I want you to act as a needs assessment expert."}
|
14 |
|
@@ -120,7 +120,7 @@ with gr.Blocks(css=css) as demo:
|
|
120 |
|
121 |
gr.HTML('''<br><br><br><center>You can duplicate this Space to skip the queue:<a href="https://huggingface.co/spaces/anzorq/chatgpt-demo?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a><br>
|
122 |
<p><img src="https://visitor-badge.glitch.me/badge?page_id=anzorq.chatgpt_api_demo_hf" alt="visitors"></p></center>''')
|
123 |
-
|
124 |
btn_submit.click(submit_message, [key, input_message, prompt_template, temperature, max_tokens, context_length, state], [input_message, chatbot, total_tokens_str, state])
|
125 |
input_message.submit(submit_message, [key, input_message, prompt_template, temperature, max_tokens, context_length, state], [input_message, chatbot, total_tokens_str, state])
|
126 |
btn_clear_conversation.click(clear_conversation, [], [input_message, chatbot, total_tokens_str, state])
|
|
|
8 |
|
9 |
|
10 |
openai.api_key = os.environ['openai_key']
|
11 |
+
|
12 |
|
13 |
prompt_templates = {"All Needs Gurus": "I want you to act as a needs assessment expert."}
|
14 |
|
|
|
120 |
|
121 |
gr.HTML('''<br><br><br><center>You can duplicate this Space to skip the queue:<a href="https://huggingface.co/spaces/anzorq/chatgpt-demo?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a><br>
|
122 |
<p><img src="https://visitor-badge.glitch.me/badge?page_id=anzorq.chatgpt_api_demo_hf" alt="visitors"></p></center>''')
|
123 |
+
key = os.environ['openai_key']
|
124 |
btn_submit.click(submit_message, [key, input_message, prompt_template, temperature, max_tokens, context_length, state], [input_message, chatbot, total_tokens_str, state])
|
125 |
input_message.submit(submit_message, [key, input_message, prompt_template, temperature, max_tokens, context_length, state], [input_message, chatbot, total_tokens_str, state])
|
126 |
btn_clear_conversation.click(clear_conversation, [], [input_message, chatbot, total_tokens_str, state])
|