Spaces:
Running
on
Zero
Running
on
Zero
fd
Browse files
mysite/interpreter/interpreter.py
CHANGED
@@ -75,7 +75,7 @@ async def completion(message: str, history, c=None, d=None, prompt="γγͺγγ―
|
|
75 |
messages.insert(0, system_prompt)
|
76 |
async with async_timeout.timeout(GENERATION_TIMEOUT_SEC):
|
77 |
try:
|
78 |
-
stream = client.chat.completions.create(
|
79 |
model="llama3-8b-8192",
|
80 |
messages=messages,
|
81 |
temperature=1,
|
@@ -85,7 +85,7 @@ async def completion(message: str, history, c=None, d=None, prompt="γγͺγγ―
|
|
85 |
stop=None,
|
86 |
)
|
87 |
all_result = ""
|
88 |
-
|
89 |
current_content = chunk.choices[0].delta.content or ""
|
90 |
all_result += current_content
|
91 |
yield current_content
|
|
|
75 |
messages.insert(0, system_prompt)
|
76 |
async with async_timeout.timeout(GENERATION_TIMEOUT_SEC):
|
77 |
try:
|
78 |
+
stream = await client.chat.completions.create(
|
79 |
model="llama3-8b-8192",
|
80 |
messages=messages,
|
81 |
temperature=1,
|
|
|
85 |
stop=None,
|
86 |
)
|
87 |
all_result = ""
|
88 |
+
for chunk in stream:
|
89 |
current_content = chunk.choices[0].delta.content or ""
|
90 |
all_result += current_content
|
91 |
yield current_content
|