Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,8 @@ API_URL = "https://api.openai.com/v1/chat/completions" #os.getenv("API_URL") + "
|
|
13 |
def predict(inputs, top_p, temperature, openai_api_key, chat_counter, chatbot=[], history=[]): #repetition_penalty, top_k
|
14 |
|
15 |
payload = {
|
16 |
-
"model": "gpt-4-1106-preview",
|
|
|
17 |
"messages": [{"role": "user", "content": f"{inputs}"}],
|
18 |
"temperature" : 1.0,
|
19 |
"top_p":1.0,
|
@@ -46,7 +47,8 @@ def predict(inputs, top_p, temperature, openai_api_key, chat_counter, chatbot=[]
|
|
46 |
messages.append(temp3)
|
47 |
#messages
|
48 |
payload = {
|
49 |
-
"model": "gpt-4-1106-preview",
|
|
|
50 |
"messages": messages, #[{"role": "user", "content": f"{inputs}"}],
|
51 |
"temperature" : temperature, #1.0,
|
52 |
"top_p": top_p, #1.0,
|
@@ -93,7 +95,7 @@ def predict(inputs, top_p, temperature, openai_api_key, chat_counter, chatbot=[]
|
|
93 |
def reset_textbox():
|
94 |
return gr.update(value='')
|
95 |
|
96 |
-
title = """<h1 align="center">🔥ChatGPT-
|
97 |
description = """Language models can be conditioned to act like dialogue agents through a conversational prompt that typically takes the form:
|
98 |
```
|
99 |
User: <utterance>
|
|
|
13 |
def predict(inputs, top_p, temperature, openai_api_key, chat_counter, chatbot=[], history=[]): #repetition_penalty, top_k
|
14 |
|
15 |
payload = {
|
16 |
+
#"model": "gpt-4-1106-preview",
|
17 |
+
"model": "gpt-3.5-turbo",
|
18 |
"messages": [{"role": "user", "content": f"{inputs}"}],
|
19 |
"temperature" : 1.0,
|
20 |
"top_p":1.0,
|
|
|
47 |
messages.append(temp3)
|
48 |
#messages
|
49 |
payload = {
|
50 |
+
#"model": "gpt-4-1106-preview",
|
51 |
+
"model": "gpt-3.5-turbo",
|
52 |
"messages": messages, #[{"role": "user", "content": f"{inputs}"}],
|
53 |
"temperature" : temperature, #1.0,
|
54 |
"top_p": top_p, #1.0,
|
|
|
95 |
def reset_textbox():
|
96 |
return gr.update(value='')
|
97 |
|
98 |
+
title = """<h1 align="center">🔥ChatGPT-3.5 Turbo API 🚀Streaming🚀</h1>"""
|
99 |
description = """Language models can be conditioned to act like dialogue agents through a conversational prompt that typically takes the form:
|
100 |
```
|
101 |
User: <utterance>
|