Spaces:
Running
Running
create app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ API_URL = "https://api.openai.com/v1/chat/completions" #os.getenv("API_URL") + "
|
|
| 12 |
def predict(inputs, top_p, temperature, openai_api_key, chat_counter, chatbot=[], history=[]): #repetition_penalty, top_k
|
| 13 |
|
| 14 |
payload = {
|
| 15 |
-
"model": "gpt-
|
| 16 |
"messages": [{"role": "user", "content": f"{inputs}"}],
|
| 17 |
"temperature" : 1.0,
|
| 18 |
"top_p":1.0,
|
|
@@ -45,7 +45,7 @@ def predict(inputs, top_p, temperature, openai_api_key, chat_counter, chatbot=[]
|
|
| 45 |
messages.append(temp3)
|
| 46 |
#messages
|
| 47 |
payload = {
|
| 48 |
-
"model": "gpt-
|
| 49 |
"messages": messages, #[{"role": "user", "content": f"{inputs}"}],
|
| 50 |
"temperature" : temperature, #1.0,
|
| 51 |
"top_p": top_p, #1.0,
|
|
@@ -101,7 +101,7 @@ User: <utterance>
|
|
| 101 |
Assistant: <utterance>
|
| 102 |
...
|
| 103 |
```
|
| 104 |
-
In this app, you can explore the outputs of a gpt-
|
| 105 |
"""
|
| 106 |
|
| 107 |
with gr.Blocks(css = """#col_container {width: 1000px; margin-left: auto; margin-right: auto;}
|
|
|
|
| 12 |
def predict(inputs, top_p, temperature, openai_api_key, chat_counter, chatbot=[], history=[]): #repetition_penalty, top_k
|
| 13 |
|
| 14 |
payload = {
|
| 15 |
+
"model": "gpt-4",
|
| 16 |
"messages": [{"role": "user", "content": f"{inputs}"}],
|
| 17 |
"temperature" : 1.0,
|
| 18 |
"top_p":1.0,
|
|
|
|
| 45 |
messages.append(temp3)
|
| 46 |
#messages
|
| 47 |
payload = {
|
| 48 |
+
"model": "gpt-4",
|
| 49 |
"messages": messages, #[{"role": "user", "content": f"{inputs}"}],
|
| 50 |
"temperature" : temperature, #1.0,
|
| 51 |
"top_p": top_p, #1.0,
|
|
|
|
| 101 |
Assistant: <utterance>
|
| 102 |
...
|
| 103 |
```
|
| 104 |
+
In this app, you can explore the outputs of a gpt-4 LLM.
|
| 105 |
"""
|
| 106 |
|
| 107 |
with gr.Blocks(css = """#col_container {width: 1000px; margin-left: auto; margin-right: auto;}
|