Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,6 @@ import os
|
|
3 |
import json
|
4 |
import requests
|
5 |
|
6 |
-
###gr.themes.builder()
|
7 |
|
8 |
#Streaming endpoint
|
9 |
API_URL = "https://api.openai.com/v1/chat/completions" #os.getenv("API_URL") + "/generate_stream"
|
@@ -109,16 +108,15 @@ In this app, you can explore the outputs of a gpt-3.5-turbo LLM.
|
|
109 |
css = """
|
110 |
#col_container {width: 1000px; margin-left: auto; margin-right: auto;}
|
111 |
#chatbot {height: 520px; overflow: auto;}
|
112 |
-
.large-textbox textarea {height: 200;}
|
113 |
"""
|
114 |
|
115 |
with gr.Blocks(css=css) as demo:
|
116 |
gr.HTML(title)
|
117 |
gr.HTML('''<center><a href="https://huggingface.co/spaces/ysharma/ChatGPTwithAPI?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>Duplicate the Space and run securely with your OpenAI API Key</center>''')
|
118 |
-
with gr.Column(elem_id="col_container"):
|
119 |
openai_api_key = gr.Textbox(type='password', label="Enter your OpenAI API key here")
|
120 |
chatbot = gr.Chatbot(elem_id="chatbot")
|
121 |
-
inputs = gr.Textbox(placeholder="Hi there!", label="Type an input and press Enter"
|
122 |
state = gr.State([])
|
123 |
b1 = gr.Button()
|
124 |
|
|
|
3 |
import json
|
4 |
import requests
|
5 |
|
|
|
6 |
|
7 |
#Streaming endpoint
|
8 |
API_URL = "https://api.openai.com/v1/chat/completions" #os.getenv("API_URL") + "/generate_stream"
|
|
|
108 |
css = """
|
109 |
#col_container {width: 1000px; margin-left: auto; margin-right: auto;}
|
110 |
#chatbot {height: 520px; overflow: auto;}
|
|
|
111 |
"""
|
112 |
|
113 |
with gr.Blocks(css=css) as demo:
|
114 |
gr.HTML(title)
|
115 |
gr.HTML('''<center><a href="https://huggingface.co/spaces/ysharma/ChatGPTwithAPI?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>Duplicate the Space and run securely with your OpenAI API Key</center>''')
|
116 |
+
with gr.Column(elem_id="col_container", scale=2):
|
117 |
openai_api_key = gr.Textbox(type='password', label="Enter your OpenAI API key here")
|
118 |
chatbot = gr.Chatbot(elem_id="chatbot")
|
119 |
+
inputs = gr.Textbox(placeholder="Hi there!", label="Type an input and press Enter")
|
120 |
state = gr.State([])
|
121 |
b1 = gr.Button()
|
122 |
|