Text Generation
Transformers
Safetensors
mistral
math
orchestration_of_experts
custom_code
text-generation-inference
Instructions to use leeroo/LeerooDedicated-Math-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use leeroo/LeerooDedicated-Math-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="leeroo/LeerooDedicated-Math-7b", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("leeroo/LeerooDedicated-Math-7b", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("leeroo/LeerooDedicated-Math-7b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use leeroo/LeerooDedicated-Math-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "leeroo/LeerooDedicated-Math-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "leeroo/LeerooDedicated-Math-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/leeroo/LeerooDedicated-Math-7b
- SGLang
How to use leeroo/LeerooDedicated-Math-7b 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 "leeroo/LeerooDedicated-Math-7b" \ --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": "leeroo/LeerooDedicated-Math-7b", "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 "leeroo/LeerooDedicated-Math-7b" \ --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": "leeroo/LeerooDedicated-Math-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use leeroo/LeerooDedicated-Math-7b with Docker Model Runner:
docker model run hf.co/leeroo/LeerooDedicated-Math-7b
Update README.md
Browse files
README.md
CHANGED
|
@@ -10,7 +10,7 @@ datasets:
|
|
| 10 |
|
| 11 |
The model is built by applying [Orchestration of Expert](https://arxiv.org/abs/2401.13979) for the math domain. The dedicated model either generates solutions or, when necessary, utilizes GPT-4 (or similar performing LLM) to fill in gaps in its knowledge base. Specifically, when given an input, the dedicated model first determines if the input question is solvable with the base model. If solvable, the orchestrator is detached, and token generation is invoked using the base LLM expert. If the problem is difficult and requires a larger model like GPT-4, it produces `<GPT4>` token (i.e., token_id=32000).
|
| 12 |
|
| 13 |
-
The Orchestrator is trained to estimate the knowledge of the base model, for any given query, then we marge into the base model (MetaMath7b, here).
|
| 14 |
In general for **any domain**, you can build it by:
|
| 15 |
- Choose a base LLM expert 🤗
|
| 16 |
- Train a domain-specific Orchestrator
|
|
|
|
| 10 |
|
| 11 |
The model is built by applying [Orchestration of Expert](https://arxiv.org/abs/2401.13979) for the math domain. The dedicated model either generates solutions or, when necessary, utilizes GPT-4 (or similar performing LLM) to fill in gaps in its knowledge base. Specifically, when given an input, the dedicated model first determines if the input question is solvable with the base model. If solvable, the orchestrator is detached, and token generation is invoked using the base LLM expert. If the problem is difficult and requires a larger model like GPT-4, it produces `<GPT4>` token (i.e., token_id=32000).
|
| 12 |
|
| 13 |
+
The Orchestrator is first trained to estimate the knowledge of the base model, for any given query, then we marge into the base model (MetaMath7b, here).
|
| 14 |
In general for **any domain**, you can build it by:
|
| 15 |
- Choose a base LLM expert 🤗
|
| 16 |
- Train a domain-specific Orchestrator
|