abdullahalioo commited on
Commit
8269cf3
·
verified ·
1 Parent(s): a6a8da7

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -1
main.py CHANGED
@@ -73,7 +73,9 @@ async def generate_response_chunks(prompt: str):
73
  await asyncio.sleep(0.01) # Control streaming speed
74
  logger.info("Streaming completed.")
75
 
76
- return stream_tokens()
 
 
77
 
78
  except Exception as e:
79
  logger.error(f"Error during generation: {e}")
 
73
  await asyncio.sleep(0.01) # Control streaming speed
74
  logger.info("Streaming completed.")
75
 
76
+ # Yield tokens from stream_tokens
77
+ async for token in stream_tokens():
78
+ yield token
79
 
80
  except Exception as e:
81
  logger.error(f"Error during generation: {e}")