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
|
@@ -9,19 +9,22 @@ tags:
|
|
| 9 |
- unsloth
|
| 10 |
---
|
| 11 |
|
| 12 |
-
#
|
| 13 |
|
| 14 |
-
|
|
|
|
| 15 |
|
|
|
|
| 16 |
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
### Model Description
|
| 21 |
-
|
| 22 |
-
<!-- Provide a longer summary of what this model is. -->
|
| 23 |
|
|
|
|
|
|
|
| 24 |
|
|
|
|
| 25 |
|
| 26 |
- **Developed by:** Alan Joshua
|
| 27 |
- **Model type:** Text-Generation
|
|
@@ -30,6 +33,11 @@ tags:
|
|
| 30 |
- **Finetuned from model:** unsloth/mistral-7b-bnb-4bit
|
| 31 |
- **Dataset:** ruslanmv/ai-medical-chatbot
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
### Model Sources [optional]
|
| 34 |
|
| 35 |
<!-- Provide the basic links for the model. -->
|
|
|
|
| 9 |
- unsloth
|
| 10 |
---
|
| 11 |
|
| 12 |
+
## Use this model
|
| 13 |
|
| 14 |
+
```python
|
| 15 |
+
!pip install -q --upgrade bitsandbytes transformers accelerate
|
| 16 |
|
| 17 |
+
from transformers import pipeline
|
| 18 |
|
| 19 |
+
pipe = pipeline("text-generation", model="alanjoshua2005/alan-mistral-finetuned")
|
| 20 |
|
| 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 |
+
print(result[0]["generated_text"])
|
| 25 |
+
```
|
| 26 |
|
| 27 |
+
## Model Details
|
| 28 |
|
| 29 |
- **Developed by:** Alan Joshua
|
| 30 |
- **Model type:** Text-Generation
|
|
|
|
| 33 |
- **Finetuned from model:** unsloth/mistral-7b-bnb-4bit
|
| 34 |
- **Dataset:** ruslanmv/ai-medical-chatbot
|
| 35 |
|
| 36 |
+
|
| 37 |
+
### Model Description
|
| 38 |
+
|
| 39 |
+
<!-- Provide a longer summary of what this model is. -->
|
| 40 |
+
|
| 41 |
### Model Sources [optional]
|
| 42 |
|
| 43 |
<!-- Provide the basic links for the model. -->
|