model = ChatOpenAI( base_url='http://localhost:5551/v1', api_key='EMPTY', model_name='Qwen2.5-7B-Instruct', temperature=0.2, )
query = "Tell me one joke about Computer Science"
# Stream the response instead of invoking it directly response = model.stream(query)
# Print the streamed response token by token for token in response: print(token.content, end="", flush=True)
Sure! Here's a light-hearted joke about computer science:
Why did the computer go to the doctor?
Because it had a virus and needed to get "anti-virus"!