Update app.py
Browse files
app.py
CHANGED
|
@@ -2,12 +2,11 @@ import gradio as gr
|
|
| 2 |
import openai
|
| 3 |
import requests
|
| 4 |
import csv
|
| 5 |
-
import streamlit as st
|
| 6 |
|
| 7 |
|
| 8 |
prompt_templates = {"Default ChatGPT": ""}
|
| 9 |
|
| 10 |
-
|
| 11 |
|
| 12 |
def get_empty_state():
|
| 13 |
return {"total_tokens": 0, "messages": []}
|
|
@@ -114,7 +113,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 114 |
total_tokens_str = gr.Markdown(elem_id="total_tokens_str")
|
| 115 |
btn_clear_conversation = gr.Button("π Start New Conversation")
|
| 116 |
with gr.Column():
|
| 117 |
-
user_token = gr.Textbox(value=
|
| 118 |
prompt_template = gr.Dropdown(label="Set a custom insruction for the chatbot:", choices=list(prompt_templates.keys()))
|
| 119 |
prompt_template_preview = gr.Textbox(value="prompt_template_preview", type="text", show_label=False)
|
| 120 |
with gr.Accordion("Advanced parameters", open=False):
|
|
|
|
| 2 |
import openai
|
| 3 |
import requests
|
| 4 |
import csv
|
|
|
|
| 5 |
|
| 6 |
|
| 7 |
prompt_templates = {"Default ChatGPT": ""}
|
| 8 |
|
| 9 |
+
|
| 10 |
|
| 11 |
def get_empty_state():
|
| 12 |
return {"total_tokens": 0, "messages": []}
|
|
|
|
| 113 |
total_tokens_str = gr.Markdown(elem_id="total_tokens_str")
|
| 114 |
btn_clear_conversation = gr.Button("π Start New Conversation")
|
| 115 |
with gr.Column():
|
| 116 |
+
user_token = gr.Textbox(value='', placeholder="OpenAI API Key", type="password", show_label=False)
|
| 117 |
prompt_template = gr.Dropdown(label="Set a custom insruction for the chatbot:", choices=list(prompt_templates.keys()))
|
| 118 |
prompt_template_preview = gr.Textbox(value="prompt_template_preview", type="text", show_label=False)
|
| 119 |
with gr.Accordion("Advanced parameters", open=False):
|