Instructions to use Kangheng/Merlin-chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kangheng/Merlin-chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kangheng/Merlin-chat")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Kangheng/Merlin-chat") model = AutoModelForCausalLM.from_pretrained("Kangheng/Merlin-chat", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Kangheng/Merlin-chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kangheng/Merlin-chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kangheng/Merlin-chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Kangheng/Merlin-chat
- SGLang
How to use Kangheng/Merlin-chat 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 "Kangheng/Merlin-chat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kangheng/Merlin-chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Kangheng/Merlin-chat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kangheng/Merlin-chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Kangheng/Merlin-chat with Docker Model Runner:
docker model run hf.co/Kangheng/Merlin-chat
| split,action_recognition,attribute_comparison,attribute_recognition,celebrity_recognition,function_reasoning,future_prediction,identity_reasoning,image_emotion,image_quality,image_scene,image_style,image_topic,nature_relation,object_localization,ocr,physical_property_reasoning,physical_relation,social_relation,spatial_relationship,structuralized_imagetext_understanding | |
| full,0.8035714285714286,0.5909090909090909,0.7792207792207793,0.797979797979798,0.7283950617283951,0.5476190476190477,0.9777777777777777,0.86,0.2777777777777778,0.9428571428571428,0.7735849056603774,0.8333333333333334,0.5208333333333334,0.41975308641975306,0.65,0.5466666666666666,0.625,0.9069767441860465,0.2222222222222222,0.3076923076923077 | |
| dev,0.8035714285714286,0.5909090909090909,0.7792207792207793,0.797979797979798,0.7283950617283951,0.5476190476190477,0.9777777777777777,0.86,0.2777777777777778,0.9428571428571428,0.7735849056603774,0.8333333333333334,0.5208333333333334,0.41975308641975306,0.65,0.5466666666666666,0.625,0.9069767441860465,0.2222222222222222,0.3076923076923077 | |
| test,,,,,,,,,,,,,,,,,,,, | |