test_llm_server.py 539 B

1234567891011121314151617181920
  1. import sys
  2. import os
  3. parent_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')
  4. sys.path.append(parent_dir)
  5. from qwen_agent.llm.llm_client import LLMClient
  6. lianqi_client = LLMClient(
  7. model='Yi_34B', model_server='http://10.10.0.10:7901/v1'
  8. )
  9. query = '北京哪里适合旅游,请带我去看看吧?'
  10. query = '你好!'
  11. response = lianqi_client.chat(query=query, stream=True)
  12. # from vllm.sampling_params import SamplingParams
  13. for rsp in response:
  14. # print(rsp, end='', flush=True)
  15. pass
  16. # print(response)