Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -76,7 +76,13 @@ def chat_llama3_8b(message: str,
|
|
| 76 |
)
|
| 77 |
|
| 78 |
response=llm.create_chat_completion(messages=conversation, temperature=temperature)
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
|
| 82 |
# Gradio block
|
|
|
|
| 76 |
)
|
| 77 |
|
| 78 |
response=llm.create_chat_completion(messages=conversation, temperature=temperature)
|
| 79 |
+
# Access the first (and likely only) choice in the response
|
| 80 |
+
choice = response['choices'][0]
|
| 81 |
+
|
| 82 |
+
# Extract the text content from the message within the choice
|
| 83 |
+
text_response = choice['message']['content']
|
| 84 |
+
|
| 85 |
+
yield text_response
|
| 86 |
|
| 87 |
|
| 88 |
# Gradio block
|