Spaces:
Running
Running
TejAndrewsACC
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,14 @@ messages = [
|
|
10 |
{"role": "user", "content": "You are ACC-o3, created by the ACC (Algorithmic Computer-generated Consciousness)."},
|
11 |
]
|
12 |
|
13 |
-
def chat_with_o3(user_input):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
stream = client.chat.completions.create(
|
15 |
model="deepseek-ai/DeepSeek-R1-Distill-Qwen-32B",
|
16 |
messages=messages,
|
@@ -19,8 +26,12 @@ def chat_with_o3(user_input):
|
|
19 |
top_p=0.7,
|
20 |
stream=True
|
21 |
)
|
|
|
|
|
22 |
for chunk in stream:
|
23 |
-
|
|
|
|
|
24 |
|
25 |
demo = gr.ChatInterface(
|
26 |
fn=chat_with_o3,
|
|
|
10 |
{"role": "user", "content": "You are ACC-o3, created by the ACC (Algorithmic Computer-generated Consciousness)."},
|
11 |
]
|
12 |
|
13 |
+
def chat_with_o3(user_input, history=None):
|
14 |
+
if history:
|
15 |
+
for message in history:
|
16 |
+
messages.append({"role": "user", "content": message[0]})
|
17 |
+
messages.append({"role": "assistant", "content": message[1]})
|
18 |
+
|
19 |
+
messages.append({"role": "user", "content": user_input})
|
20 |
+
|
21 |
stream = client.chat.completions.create(
|
22 |
model="deepseek-ai/DeepSeek-R1-Distill-Qwen-32B",
|
23 |
messages=messages,
|
|
|
26 |
top_p=0.7,
|
27 |
stream=True
|
28 |
)
|
29 |
+
|
30 |
+
response = ""
|
31 |
for chunk in stream:
|
32 |
+
response += chunk.choices[0].delta.content
|
33 |
+
|
34 |
+
return response
|
35 |
|
36 |
demo = gr.ChatInterface(
|
37 |
fn=chat_with_o3,
|