Christoph Holthaus
commited on
Commit
·
9f4ac5e
1
Parent(s):
3c5e66e
dev
Browse files
app.py
CHANGED
@@ -80,15 +80,11 @@ def generate(
|
|
80 |
conversation.append({"role": "user", "content": message})
|
81 |
|
82 |
# Use LLaMa to create chat completion
|
83 |
-
llm.create_chat_completion(conversation, stream=True)
|
84 |
|
85 |
-
#
|
86 |
-
|
87 |
-
|
88 |
-
outputs = []
|
89 |
-
for text in streamer:
|
90 |
-
outputs.append(text)
|
91 |
-
yield "".join(outputs)
|
92 |
|
93 |
chat_interface = gr.ChatInterface(
|
94 |
fn=generate,
|
|
|
80 |
conversation.append({"role": "user", "content": message})
|
81 |
|
82 |
# Use LLaMa to create chat completion
|
83 |
+
chat_completion = llm.create_chat_completion(conversation, stream=True)
|
84 |
|
85 |
+
# Yield the chat completions
|
86 |
+
for completion in chat_completion:
|
87 |
+
yield ("assistant", completion["choices"][0]["message"]["content"])
|
|
|
|
|
|
|
|
|
88 |
|
89 |
chat_interface = gr.ChatInterface(
|
90 |
fn=generate,
|