Text Generation
Transformers
PyTorch
Safetensors
mixtral
mteb
conversational
custom_code
Eval Results (legacy)
text-generation-inference
Instructions to use GritLM/GritLM-8x7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GritLM/GritLM-8x7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="GritLM/GritLM-8x7B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("GritLM/GritLM-8x7B", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("GritLM/GritLM-8x7B", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use GritLM/GritLM-8x7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GritLM/GritLM-8x7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GritLM/GritLM-8x7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/GritLM/GritLM-8x7B
- SGLang
How to use GritLM/GritLM-8x7B 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 "GritLM/GritLM-8x7B" \ --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": "GritLM/GritLM-8x7B", "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 "GritLM/GritLM-8x7B" \ --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": "GritLM/GritLM-8x7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use GritLM/GritLM-8x7B with Docker Model Runner:
docker model run hf.co/GritLM/GritLM-8x7B
Update README.md
Browse files
README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
| 2 |
pipeline_tag: text-generation
|
| 3 |
inference: true
|
| 4 |
license: apache-2.0
|
|
|
|
|
|
|
| 5 |
---
|
| 6 |
|
| 7 |
# Table of Contents
|
|
@@ -13,39 +15,22 @@ license: apache-2.0
|
|
| 13 |
|
| 14 |
# Model Summary
|
| 15 |
|
| 16 |
-
> GritLM is a generative
|
| 17 |
|
| 18 |
- **Repository:** [ContextualAI/gritlm](https://github.com/ContextualAI/gritlm)
|
| 19 |
- **Paper:** [TODO](https://arxiv.org/abs/2308.07124)
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
# Training
|
| 26 |
-
|
| 27 |
-
## Model
|
| 28 |
|
| 29 |
-
|
| 30 |
-
- **Steps:** 250k pretraining & 30 instruction tuning
|
| 31 |
-
- **Pretraining tokens:** ? pretraining & 2M instruction tuning
|
| 32 |
-
- **Precision:** bfloat16
|
| 33 |
-
|
| 34 |
-
## Hardware
|
| 35 |
-
|
| 36 |
-
- **Pretraining:**
|
| 37 |
-
- **GPUs:** 512 Tesla A100
|
| 38 |
-
- **Training time:** 1 day
|
| 39 |
-
- **Instruction tuning:**
|
| 40 |
-
- **GPUs:** 8 Tesla A100
|
| 41 |
-
- **Training time:** 4 hours
|
| 42 |
-
|
| 43 |
-
## Software
|
| 44 |
|
| 45 |
-
|
| 46 |
|
| 47 |
# Citation
|
| 48 |
|
| 49 |
```bibtex
|
| 50 |
TODO
|
| 51 |
-
```
|
|
|
|
| 2 |
pipeline_tag: text-generation
|
| 3 |
inference: true
|
| 4 |
license: apache-2.0
|
| 5 |
+
datasets:
|
| 6 |
+
- GritLM/tulu2
|
| 7 |
---
|
| 8 |
|
| 9 |
# Table of Contents
|
|
|
|
| 15 |
|
| 16 |
# Model Summary
|
| 17 |
|
| 18 |
+
> GritLM is a generative representational instruction tuned language model. It unifies text representation (embedding) and text generation into a single model achieving state-of-the-art performance on both types of tasks.
|
| 19 |
|
| 20 |
- **Repository:** [ContextualAI/gritlm](https://github.com/ContextualAI/gritlm)
|
| 21 |
- **Paper:** [TODO](https://arxiv.org/abs/2308.07124)
|
| 22 |
|
| 23 |
+
| Model | Description |
|
| 24 |
+
|-------|-------------|
|
| 25 |
+
| [GritLM 7B](https://hf.co/GritLM/GritLM-7B) | Mistral 7B finetuned using GRIT |
|
| 26 |
+
| [GritLM 8x7B](https://hf.co/GritLM/GritLM-8x7B) | Mixtral 8x7B finetuned using GRIT |
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
+
# Use
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
The model usage is documented [here](TODO). It supports GritLM, Transformers, Sentence Transformers.
|
| 31 |
|
| 32 |
# Citation
|
| 33 |
|
| 34 |
```bibtex
|
| 35 |
TODO
|
| 36 |
+
```
|