Text Generation
Transformers
Safetensors
Chinese
qwen2
medical
conversational
text-generation-inference
Instructions to use jun10k/Qwen1.5-7B-MeChat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jun10k/Qwen1.5-7B-MeChat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jun10k/Qwen1.5-7B-MeChat") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jun10k/Qwen1.5-7B-MeChat") model = AutoModelForCausalLM.from_pretrained("jun10k/Qwen1.5-7B-MeChat") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use jun10k/Qwen1.5-7B-MeChat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jun10k/Qwen1.5-7B-MeChat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jun10k/Qwen1.5-7B-MeChat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jun10k/Qwen1.5-7B-MeChat
- SGLang
How to use jun10k/Qwen1.5-7B-MeChat with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "jun10k/Qwen1.5-7B-MeChat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jun10k/Qwen1.5-7B-MeChat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "jun10k/Qwen1.5-7B-MeChat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jun10k/Qwen1.5-7B-MeChat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use jun10k/Qwen1.5-7B-MeChat with Docker Model Runner:
docker model run hf.co/jun10k/Qwen1.5-7B-MeChat
| {"query": "我最近准备高考,感觉压力很大", "response": "高考确实是一个重要的考试,会给你带来很大的压力。但是你要相信自己的能力,相信你已经做了充分的准备。同时,也要学会放松自己,找到适合自己的减压方式,比如运动、听音乐、与朋友聊天等。记住,你不是一个人在战斗,身边还有很多人支持你。", "history": []} | |
| {"query": "我现在完全没有学习的动力和方向,我对高考一点信心都没有了", "response": "我理解你现在的困惑和失望。但是请相信,高考只是人生中的一小部分,它并不代表你的全部价值和未来。你可以尝试寻找一些激励自己的方法,比如与身边的朋友交流,听听他们的故事和经验,或者寻求一些专业的心理咨询师的帮助。同时,也要学会给自己一些积极的肯定和鼓励,相信自己的能力,相信自己能够克服困难。", "history": [["我最近准备高考,感觉压力很大", "高考确实是一个重要的考试,会给你带来很大的压力。但是你要相信自己的能力,相信你已经做了充分的准备。同时,也要学会放松自己,找到适合自己的减压方式,比如运动、听音乐、与朋友聊天等。记住,你不是一个人在战斗,身边还有很多人支持你。"]]} | |