Instructions to use damfle/ornith-9b-custom with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use damfle/ornith-9b-custom with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="damfle/ornith-9b-custom") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("damfle/ornith-9b-custom") model = AutoModelForMultimodalLM.from_pretrained("damfle/ornith-9b-custom", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use damfle/ornith-9b-custom with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "damfle/ornith-9b-custom" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "damfle/ornith-9b-custom", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/damfle/ornith-9b-custom
- SGLang
How to use damfle/ornith-9b-custom 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 "damfle/ornith-9b-custom" \ --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": "damfle/ornith-9b-custom", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "damfle/ornith-9b-custom" \ --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": "damfle/ornith-9b-custom", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use damfle/ornith-9b-custom with Docker Model Runner:
docker model run hf.co/damfle/ornith-9b-custom
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,85 @@
|
|
| 1 |
---
|
| 2 |
license: isc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: isc
|
| 3 |
+
datasets:
|
| 4 |
+
- damfle/private-multistral-compiled-datasets
|
| 5 |
+
- mlabonne/open-perfectblend
|
| 6 |
+
language:
|
| 7 |
+
- fr
|
| 8 |
+
- en
|
| 9 |
+
base_model:
|
| 10 |
+
- ornith-ai/Ornith-1.0-9B
|
| 11 |
+
library_name: transformers
|
| 12 |
---
|
| 13 |
+
# Ornith-9B Custom
|
| 14 |
+
|
| 15 |
+
A fine-tuned version of [Ornith-1.0-9B](https://huggingface.co/ornith-ai/Ornith-1.0-9B) by [Damien FLETY](https://huggingface.co/damfle).
|
| 16 |
+
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
## Model Details
|
| 20 |
+
|
| 21 |
+
- **Base Model**: [Ornith-1.0-9B](https://huggingface.co/ornith-ai/Ornith-1.0-9B)
|
| 22 |
+
- **Fine-tuned by**: [damfle](https://huggingface.co/damfle)
|
| 23 |
+
- **License**: Inherits the license of the base model (check [Ornith-1.0-9B](https://huggingface.co/ornith-ai/Ornith-1.0-9B) for details).
|
| 24 |
+
- **Quantization**: Optimized for 4-bit quantization (QAT) and FP8 training. (soon)
|
| 25 |
+
|
| 26 |
+
---
|
| 27 |
+
|
| 28 |
+
## Intended Use
|
| 29 |
+
|
| 30 |
+
This model is designed for:
|
| 31 |
+
|
| 32 |
+
- Efficient inference in quantized (4-bit) form. (soon)
|
| 33 |
+
- Integration into RAG (Retrieval-Augmented Generation) pipelines.
|
| 34 |
+
|
| 35 |
+
---
|
| 36 |
+
|
| 37 |
+
## Training Configuration
|
| 38 |
+
|
| 39 |
+
- **Dataset**: Custom dataset (details not specified).
|
| 40 |
+
- **Training Approach**:
|
| 41 |
+
- Quantization-Aware Training (QAT) for 4-bit inference.
|
| 42 |
+
- **Optimizer**: Muon optimizer (preferred for efficiency).
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
## Performance
|
| 47 |
+
|
| 48 |
+
- **Inference**: Optimized for low-latency, high-throughput inference in quantized form. (dspark soon)
|
| 49 |
+
|
| 50 |
+
---
|
| 51 |
+
|
| 52 |
+
## How to Use
|
| 53 |
+
|
| 54 |
+
### Inference (4-bit Quantized)
|
| 55 |
+
|
| 56 |
+
```python
|
| 57 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 58 |
+
|
| 59 |
+
model_name = "damfle/ornith-9b-custom"
|
| 60 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 61 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 62 |
+
model_name,
|
| 63 |
+
device_map="auto",
|
| 64 |
+
load_in_4bit=True,
|
| 65 |
+
bnb_4bit_compute_dtype=torch.float16
|
| 66 |
+
)
|
| 67 |
+
|
| 68 |
+
input_text = "Your prompt here"
|
| 69 |
+
inputs = tokenizer(input_text, return_tensors="pt").to("cuda")
|
| 70 |
+
outputs = model.generate(**inputs, max_new_tokens=100)
|
| 71 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
## Notes
|
| 76 |
+
|
| 77 |
+
- This model is part of an iterative process to merge embeddings for a transformers architecture while keeping embedding models separate for RAG.
|
| 78 |
+
- Future plans include scaling to a 16B QAT 4-bit model.
|
| 79 |
+
|
| 80 |
+
---
|
| 81 |
+
|
| 82 |
+
## Acknowledgments
|
| 83 |
+
|
| 84 |
+
- Base model: [Ornith-1.0-9B](https://huggingface.co/ornith-ai/Ornith-1.0-9B) by [Ornith AI](https://huggingface.co/ornith-ai).
|
| 85 |
+
- Fine-tuning and optimizations by [Damien FLETY](https://huggingface.co/damfle).
|