Spaces:
Running
Running
stable-diffusion-ai
commited on
Commit
·
8d9a3f4
1
Parent(s):
e33b652
upadte app.py : gpt-4 model instead of 3.5
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import sys
|
|
4 |
import json
|
5 |
import requests
|
6 |
|
7 |
-
MODEL = "gpt-
|
8 |
API_URL = os.getenv("API_URL")
|
9 |
DISABLED = os.getenv("DISABLED") == 'True'
|
10 |
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
@@ -119,7 +119,7 @@ def predict(inputs, top_p, temperature, chat_counter, chatbot, history, request:
|
|
119 |
def reset_textbox():
|
120 |
return gr.update(value='', interactive=False), gr.update(interactive=False)
|
121 |
|
122 |
-
title = """<h1 align="center">Chat GPT online</h1>"""
|
123 |
if DISABLED:
|
124 |
title = """<h1 align="center" style="color:red">This app has reached OpenAI's usage limit. We are currently requesting an increase in our quota. Please check back in a few days.</h1>"""
|
125 |
description = """Language models can be conditioned to act like dialogue agents through a conversational prompt that typically takes the form:
|
@@ -139,7 +139,7 @@ with gr.Blocks(css = """#col_container { margin-left: auto; margin-right: auto;}
|
|
139 |
#chatbot {height: 520px; overflow: auto;}""",
|
140 |
theme=theme) as demo:
|
141 |
gr.HTML(title)
|
142 |
-
gr.HTML("""<h3 align="center">This app provides you full access to GPT-
|
143 |
with gr.Column(elem_id = "col_container", visible=False) as main_block:
|
144 |
#openai_api_key = gr.Textbox(type='password', label="Enter only your OpenAI API key here")
|
145 |
chatbot = gr.Chatbot(elem_id='chatbot') #c
|
|
|
4 |
import json
|
5 |
import requests
|
6 |
|
7 |
+
MODEL = "gpt-4"
|
8 |
API_URL = os.getenv("API_URL")
|
9 |
DISABLED = os.getenv("DISABLED") == 'True'
|
10 |
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
|
|
119 |
def reset_textbox():
|
120 |
return gr.update(value='', interactive=False), gr.update(interactive=False)
|
121 |
|
122 |
+
title = """<h1 align="center">Chat GPT 4 online</h1>"""
|
123 |
if DISABLED:
|
124 |
title = """<h1 align="center" style="color:red">This app has reached OpenAI's usage limit. We are currently requesting an increase in our quota. Please check back in a few days.</h1>"""
|
125 |
description = """Language models can be conditioned to act like dialogue agents through a conversational prompt that typically takes the form:
|
|
|
139 |
#chatbot {height: 520px; overflow: auto;}""",
|
140 |
theme=theme) as demo:
|
141 |
gr.HTML(title)
|
142 |
+
gr.HTML("""<h3 align="center">This app provides you full access to Chat GPT-4 (4096 token limit) thanks to <a href="https://stablediffusion.fr">stablediffusion.fr</a>. You don't need any OPENAI API key.</h3><h4>If this app doesn't respond, it's likely due to too visitors on this page. Consider trying our <a href="https://stablediffusion.fr">Chat GPT-3.5</a> app.</h4>""")
|
143 |
with gr.Column(elem_id = "col_container", visible=False) as main_block:
|
144 |
#openai_api_key = gr.Textbox(type='password', label="Enter only your OpenAI API key here")
|
145 |
chatbot = gr.Chatbot(elem_id='chatbot') #c
|