Instructions to use EleutherAI/llemma_34b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EleutherAI/llemma_34b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EleutherAI/llemma_34b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("EleutherAI/llemma_34b") model = AutoModelForCausalLM.from_pretrained("EleutherAI/llemma_34b") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use EleutherAI/llemma_34b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EleutherAI/llemma_34b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EleutherAI/llemma_34b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/EleutherAI/llemma_34b
- SGLang
How to use EleutherAI/llemma_34b 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 "EleutherAI/llemma_34b" \ --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": "EleutherAI/llemma_34b", "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 "EleutherAI/llemma_34b" \ --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": "EleutherAI/llemma_34b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use EleutherAI/llemma_34b with Docker Model Runner:
docker model run hf.co/EleutherAI/llemma_34b
zhangir-azerbayev commited on
Commit ·
3925820
1
Parent(s): 87c9edc
yes
Browse files- README.md +56 -0
- llemma.jpg +0 -0
README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: llama2
|
| 3 |
+
datasets:
|
| 4 |
+
- EleutherAI/proof-pile-2
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
tags:
|
| 8 |
+
- math
|
| 9 |
+
- reasoning
|
| 10 |
+
---
|
| 11 |
+
<img src="llemma.jpg" width="400">
|
| 12 |
+
|
| 13 |
+
[Zhangir Azerbayev](https://zhangir-azerbayev.github.io/), [Hailey Schoelkopf](https://github.com/haileyschoelkopf), [Keiran Paster](https://keirp.com), [Marco Dos Santos](https://github.com/dsantosmarco), [Stephen McAleer](https://www.andrew.cmu.edu/user/smcaleer/), [Albert Q. Jiang](https://albertqjiang.github.io/), [Jia Deng](https://www.cs.princeton.edu/~jiadeng/), [Stella Biderman](https://www.stellabiderman.com/), [Sean Welleck](https://wellecks.com/)
|
| 14 |
+
|
| 15 |
+
[Github ](https://github.com/EleutherAI/math-lm) | [ArXiv](#)
|
| 16 |
+
|
| 17 |
+
**Llemma 34B** is a language model for mathematics. It was initialized with [Code Llama 34B](https://github.com/facebookresearch/codellama) weights, and trained on the [Proof-Pile-2](https://huggingface.co/datasets/EleutherAI/proof-pile-2) for 50B tokens.
|
| 18 |
+
|
| 19 |
+
This model also comes in a 7B parameter version: [Llemma 7B](https://huggingface.co/EleutherAI/llemma_7b).
|
| 20 |
+
|
| 21 |
+
## Evaluations
|
| 22 |
+
|
| 23 |
+
Llemma models are particularly strong at chain-of-thought mathematical reasoning and using computational tools for mathematics, such as Python and formal theorem provers.
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
### Chain-of-thought Math
|
| 27 |
+
On chain-of-thought mathematics tasks, Llemma models outperform Llama-2, Code Llama, and when controlled for model size, outperform Minerva.
|
| 28 |
+
|
| 29 |
+
| Model | Size | GSM8k | [OCW](https://openreview.net/forum?id=IFXTZERXdM7) | MMLU-STEM | [SAT](https://huggingface.co/datasets/mcaleste/sat_multiple_choice_math_may_23) | MATH |
|
| 30 |
+
|------------|------|--------|-------|-----------|-------|-------|
|
| 31 |
+
| Llama 2 | 7B | 11.8% | 3.7% | 29.9% | 25% | 3.2% |
|
| 32 |
+
| Code Llama | 7B | 10.5% | 4.4% | 25.1% | 9.4% | 4.4% |
|
| 33 |
+
| LLEMMA | 7B | 36.4% | 7.7% | 37.7% | 53.1% | 17.2% |
|
| 34 |
+
| Minerva | 8B | 16.2% | 7.7% | 35.6% | - | 14.1% |
|
| 35 |
+
|------------|------|--------|-------|-----------|-------|-------|
|
| 36 |
+
| Code Llama | 34B | 29.6% | 7.0% | 40.5% | 40.6% | 11.9% |
|
| 37 |
+
| LLEMMA | 34B | 51.5% | 11.8% | 49.0% | 71.9% | 24.1% |
|
| 38 |
+
|------------|------|--------|-------|-----------|-------|-------|
|
| 39 |
+
| Minerva | 62B | 52.4% | 12.0% | 53.9% | - | 27.6% |
|
| 40 |
+
| Minerva | 540B | 58.8% | 17.6% | 63.9% | - | 33.6% |
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
Further performance can be extracted by using majority voting:
|
| 44 |
+
|
| 45 |
+
| Model | Size | GSM8k maj@100 | OCW maj@100 | MMLU-STEM maj@16 | SAT maj@16 | MATH maj@256 |
|
| 46 |
+
|---------|------|-------------|-----------|-----------------|-----------|------------|
|
| 47 |
+
| LLEMMA | 7B | 54.0% | 14.3% | 49.9% | 78.1% | 32.0% |
|
| 48 |
+
| Minerva | 8B | 28.4% | 12.5% | 43.4% | - | 25.4% |
|
| 49 |
+
|---------|------|-------------|-----------|-----------------|-----------|------------|
|
| 50 |
+
| LLEMMA | 34B | 69.3% | 18.4% | 59.7% | 81.3% | 41.0% |
|
| 51 |
+
|---------|------|-------------|-----------|-----------------|-----------|------------|
|
| 52 |
+
| Minerva | 62B | 68.5% | 23.5% | 63.5% | - | 43.4% |
|
| 53 |
+
| Minerva | 540B | 78.5% | 30.8% | 75.0% | - | 50.3% |
|
| 54 |
+
|
| 55 |
+
### Tool Use and Theorem Proving
|
| 56 |
+
In addition to chain-of-thought reasoning, Llemma has strong capabilities in computational mathematics tasks. For tool use and formal theorem proving evaluations, see [our paper](#).
|
llemma.jpg
ADDED
|