Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,22 +22,16 @@ sys.excepthook = exception_handler
|
|
22 |
sys.tracebacklimit = 0
|
23 |
|
24 |
def predict(inputs, top_p, temperature, chat_counter, chatbot, history, request:gr.Request):
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
"frequency_penalty":0,
|
34 |
-
}
|
35 |
-
|
36 |
-
OPENAI_API_KEY = random.choice(OPENAI_API_KEYS)
|
37 |
-
print(OPENAI_API_KEY)
|
38 |
-
|
39 |
-
}
|
40 |
-
|
41 |
OPENAI_API_KEY = random.choice(OPENAI_API_KEYS)
|
42 |
print (OPENAI_API_KEY)
|
43 |
|
|
|
22 |
sys.tracebacklimit = 0
|
23 |
|
24 |
def predict(inputs, top_p, temperature, chat_counter, chatbot, history, request:gr.Request):
|
25 |
+
payload = {
|
26 |
+
"model": MODEL,
|
27 |
+
"messages": [{"role": "user", "content": f"{inputs}"}],
|
28 |
+
"temperature": temperature,
|
29 |
+
"top_p": top_p,
|
30 |
+
"n" : 1,
|
31 |
+
"stream": True,
|
32 |
+
"presence_penalty":0,
|
33 |
"frequency_penalty":0,
|
34 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
OPENAI_API_KEY = random.choice(OPENAI_API_KEYS)
|
36 |
print (OPENAI_API_KEY)
|
37 |
|