Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
|
@@ -149,12 +149,12 @@ User query: {query}
|
|
| 149 |
yield "I apologize, but I encountered an error while processing your query. Please try again."
|
| 150 |
|
| 151 |
# Initialize chatbot at startup
|
| 152 |
-
chatbot = PlantChatbot("
|
| 153 |
|
| 154 |
async def response_generator(query: str):
|
| 155 |
"""Wrapper generator for streaming response"""
|
| 156 |
async for chunk in chatbot.generate_response(query):
|
| 157 |
-
yield f"chunk"
|
| 158 |
|
| 159 |
@app.post("/chat")
|
| 160 |
async def chat(query: Query):
|
|
|
|
| 149 |
yield "I apologize, but I encountered an error while processing your query. Please try again."
|
| 150 |
|
| 151 |
# Initialize chatbot at startup
|
| 152 |
+
chatbot = PlantChatbot("plant_data_chunks_and_embeddings.csv")
|
| 153 |
|
| 154 |
async def response_generator(query: str):
|
| 155 |
"""Wrapper generator for streaming response"""
|
| 156 |
async for chunk in chatbot.generate_response(query):
|
| 157 |
+
yield f"{chunk}"
|
| 158 |
|
| 159 |
@app.post("/chat")
|
| 160 |
async def chat(query: Query):
|