Spaces:
Sleeping
Sleeping
Update app/main.py
Browse files- app/main.py +4 -0
app/main.py
CHANGED
@@ -41,12 +41,16 @@ async def chat(message: ChatMessage):
|
|
41 |
|
42 |
# Generate response using pipeline
|
43 |
response = pipe(messages)
|
|
|
|
|
44 |
|
45 |
# Extract the response text
|
46 |
if isinstance(response, list):
|
47 |
response_text = response[0].get('generated_text', '')
|
|
|
48 |
else:
|
49 |
response_text = response.get('generated_text', '')
|
|
|
50 |
|
51 |
return {"response": response_text}
|
52 |
|
|
|
41 |
|
42 |
# Generate response using pipeline
|
43 |
response = pipe(messages)
|
44 |
+
|
45 |
+
print(response)
|
46 |
|
47 |
# Extract the response text
|
48 |
if isinstance(response, list):
|
49 |
response_text = response[0].get('generated_text', '')
|
50 |
+
print(response_text)
|
51 |
else:
|
52 |
response_text = response.get('generated_text', '')
|
53 |
+
print(response_text)
|
54 |
|
55 |
return {"response": response_text}
|
56 |
|