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)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("CloveAI/clov-medchat", device_map="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 Desktop
- Docker Model Runner
How to use CloveAI/clov-medchat with Docker Model Runner:
docker model run hf.co/CloveAI/clov-medchat
Alan Joshua commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -21,7 +21,10 @@ pipe = pipeline("text-generation", model="alanjoshua2005/alan-mistral-finetuned"
|
|
| 21 |
prompt = "<s>[INST] What are the common symptoms of hypothyroidism? [/INST]"
|
| 22 |
result = pipe(prompt, max_new_tokens=200, do_sample=True, temperature=0.7, top_p=0.9)
|
| 23 |
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
| 25 |
```
|
| 26 |
|
| 27 |
## Model Details
|
|
|
|
| 21 |
prompt = "<s>[INST] What are the common symptoms of hypothyroidism? [/INST]"
|
| 22 |
result = pipe(prompt, max_new_tokens=200, do_sample=True, temperature=0.7, top_p=0.9)
|
| 23 |
|
| 24 |
+
generated_text = result[0]["generated_text"]
|
| 25 |
+
response = generated_text.replace(prompt, "").strip()
|
| 26 |
+
|
| 27 |
+
print(response)
|
| 28 |
```
|
| 29 |
|
| 30 |
## Model Details
|