Instructions to use CloveAI/clov-medchat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use CloveAI/clov-medchat with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/mistral-7b-instruct-v0.2-bnb-4bit") model = PeftModel.from_pretrained(base_model, "CloveAI/clov-medchat") - Transformers
How to use CloveAI/clov-medchat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CloveAI/clov-medchat") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("CloveAI/clov-medchat", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CloveAI/clov-medchat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CloveAI/clov-medchat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CloveAI/clov-medchat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/CloveAI/clov-medchat
- SGLang
How to use CloveAI/clov-medchat 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 "CloveAI/clov-medchat" \ --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": "CloveAI/clov-medchat", "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 "CloveAI/clov-medchat" \ --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": "CloveAI/clov-medchat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use CloveAI/clov-medchat with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for CloveAI/clov-medchat to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for CloveAI/clov-medchat to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for CloveAI/clov-medchat to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="CloveAI/clov-medchat", max_seq_length=2048, ) - Docker Model Runner
How to use CloveAI/clov-medchat with Docker Model Runner:
docker model run hf.co/CloveAI/clov-medchat
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 2.0, | |
| "eval_steps": 500, | |
| "global_step": 102, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.19950124688279303, | |
| "grad_norm": 2.516839958843775e-05, | |
| "learning_rate": 0.00016363636363636366, | |
| "loss": 3.0967, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.39900249376558605, | |
| "grad_norm": 2.9362299756030552e-05, | |
| "learning_rate": 0.00019621030198436006, | |
| "loss": 2.2956, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.5985037406483791, | |
| "grad_norm": 1.008875642583007e-05, | |
| "learning_rate": 0.00018130560994785325, | |
| "loss": 2.0889, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 0.7980049875311721, | |
| "grad_norm": 1.1583351806621067e-05, | |
| "learning_rate": 0.00015680647467311557, | |
| "loss": 1.9784, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 0.9975062344139651, | |
| "grad_norm": 1.18182670121314e-05, | |
| "learning_rate": 0.0001256039090057547, | |
| "loss": 1.8224, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 1.1795511221945136, | |
| "grad_norm": 1.2619072549568955e-05, | |
| "learning_rate": 9.137996201193805e-05, | |
| "loss": 1.6893, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 1.3790523690773067, | |
| "grad_norm": 1.5141326912271325e-05, | |
| "learning_rate": 5.817321992244351e-05, | |
| "loss": 1.7017, | |
| "step": 70 | |
| }, | |
| { | |
| "epoch": 1.5785536159600997, | |
| "grad_norm": 1.3717271031055134e-05, | |
| "learning_rate": 2.9902234019385057e-05, | |
| "loss": 1.7029, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 1.7780548628428927, | |
| "grad_norm": 1.1637918760243338e-05, | |
| "learning_rate": 9.903113209758096e-06, | |
| "loss": 1.6202, | |
| "step": 90 | |
| }, | |
| { | |
| "epoch": 1.9775561097256857, | |
| "grad_norm": 1.4227169231162407e-05, | |
| "learning_rate": 5.358475304807375e-07, | |
| "loss": 1.693, | |
| "step": 100 | |
| } | |
| ], | |
| "logging_steps": 10, | |
| "max_steps": 102, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 2, | |
| "save_steps": 500, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": true | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 1.4162734662392218e+17, | |
| "train_batch_size": 2, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |