cdupland commited on
Commit
b280156
·
verified ·
1 Parent(s): 0e043cb
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -296,12 +296,12 @@ async def stream_generator2(response, prompt, info_memoire):
296
  try:
297
  async for chunk in response:
298
  if isinstance(chunk, bytes):
299
- yield chunk.decode('utf-8') # Convert bytes to str if needed
300
  except asyncio.TimeoutError:
301
  raise HTTPException(status_code=504, detail="Stream timed out")
302
 
303
  @app.post("/v2/generate-answer/")
304
- def generate_answer(user_input: UserInput):
305
  try:
306
  print(user_input)
307
 
 
296
  try:
297
  async for chunk in response:
298
  if isinstance(chunk, bytes):
299
+ yield chunk
300
  except asyncio.TimeoutError:
301
  raise HTTPException(status_code=504, detail="Stream timed out")
302
 
303
  @app.post("/v2/generate-answer/")
304
+ def generate_answer2(user_input: UserInput):
305
  try:
306
  print(user_input)
307