Text Generation
Transformers
Safetensors
mistral
Merge
mergekit
lazymergekit
text-generation-inference
Instructions to use mlabonne/Beagle4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mlabonne/Beagle4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mlabonne/Beagle4")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mlabonne/Beagle4") model = AutoModelForCausalLM.from_pretrained("mlabonne/Beagle4", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mlabonne/Beagle4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mlabonne/Beagle4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlabonne/Beagle4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mlabonne/Beagle4
- SGLang
How to use mlabonne/Beagle4 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 "mlabonne/Beagle4" \ --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": "mlabonne/Beagle4", "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 "mlabonne/Beagle4" \ --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": "mlabonne/Beagle4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mlabonne/Beagle4 with Docker Model Runner:
docker model run hf.co/mlabonne/Beagle4
Update README.md
Browse files
README.md
CHANGED
|
@@ -11,9 +11,9 @@ base_model:
|
|
| 11 |
- mlabonne/NeuralOmniBeagle-7B
|
| 12 |
---
|
| 13 |
|
| 14 |
-
#
|
| 15 |
|
| 16 |
-
|
| 17 |
* [shadowml/WestBeagle-7B](https://huggingface.co/shadowml/WestBeagle-7B)
|
| 18 |
* [mlabonne/NeuralBeagle14-7B](https://huggingface.co/mlabonne/NeuralBeagle14-7B)
|
| 19 |
* [shadowml/BeagSake-7B](https://huggingface.co/shadowml/BeagSake-7B)
|
|
@@ -57,7 +57,7 @@ from transformers import AutoTokenizer
|
|
| 57 |
import transformers
|
| 58 |
import torch
|
| 59 |
|
| 60 |
-
model = "mlabonne/
|
| 61 |
messages = [{"role": "user", "content": "What is a large language model?"}]
|
| 62 |
|
| 63 |
tokenizer = AutoTokenizer.from_pretrained(model)
|
|
|
|
| 11 |
- mlabonne/NeuralOmniBeagle-7B
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# Beagle4
|
| 15 |
|
| 16 |
+
Beagle4 is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
|
| 17 |
* [shadowml/WestBeagle-7B](https://huggingface.co/shadowml/WestBeagle-7B)
|
| 18 |
* [mlabonne/NeuralBeagle14-7B](https://huggingface.co/mlabonne/NeuralBeagle14-7B)
|
| 19 |
* [shadowml/BeagSake-7B](https://huggingface.co/shadowml/BeagSake-7B)
|
|
|
|
| 57 |
import transformers
|
| 58 |
import torch
|
| 59 |
|
| 60 |
+
model = "mlabonne/Beagle4"
|
| 61 |
messages = [{"role": "user", "content": "What is a large language model?"}]
|
| 62 |
|
| 63 |
tokenizer = AutoTokenizer.from_pretrained(model)
|