Instructions to use typeof/open_llama_3b_v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use typeof/open_llama_3b_v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="typeof/open_llama_3b_v2", device_map="auto")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("typeof/open_llama_3b_v2") model = AutoModelForCausalLM.from_pretrained("typeof/open_llama_3b_v2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use typeof/open_llama_3b_v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "typeof/open_llama_3b_v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "typeof/open_llama_3b_v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/typeof/open_llama_3b_v2
- SGLang
How to use typeof/open_llama_3b_v2 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 "typeof/open_llama_3b_v2" \ --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": "typeof/open_llama_3b_v2", "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 "typeof/open_llama_3b_v2" \ --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": "typeof/open_llama_3b_v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use typeof/open_llama_3b_v2 with Docker Model Runner:
docker model run hf.co/typeof/open_llama_3b_v2
Update README.md
Browse files
README.md
CHANGED
|
@@ -6,6 +6,10 @@ datasets:
|
|
| 6 |
- togethercomputer/RedPajama-Data-1T
|
| 7 |
---
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
# OpenLLaMA: An Open Reproduction of LLaMA
|
| 10 |
|
| 11 |
**TL;DR**: we are releasing our public preview of OpenLLaMA, a permissively licensed open source reproduction of Meta AI’s LLaMA. We are releasing a series of 3B, 7B and 13B models trained on different data mixtures. Our model weights can serve as the drop in replacement of LLaMA in existing implementations.
|
|
@@ -24,14 +28,7 @@ Preview checkpoints can be directly loaded from Hugging Face Hub. **Please note
|
|
| 24 |
import torch
|
| 25 |
from transformers import LlamaTokenizer, LlamaForCausalLM
|
| 26 |
|
| 27 |
-
|
| 28 |
-
model_path = 'openlm-research/open_llama_3b_v2'
|
| 29 |
-
# model_path = 'openlm-research/open_llama_7b_v2'
|
| 30 |
-
|
| 31 |
-
## v1 models
|
| 32 |
-
# model_path = 'openlm-research/open_llama_3b'
|
| 33 |
-
# model_path = 'openlm-research/open_llama_7b'
|
| 34 |
-
# model_path = 'openlm-research/open_llama_13b'
|
| 35 |
|
| 36 |
tokenizer = LlamaTokenizer.from_pretrained(model_path)
|
| 37 |
model = LlamaForCausalLM.from_pretrained(
|
|
|
|
| 6 |
- togethercomputer/RedPajama-Data-1T
|
| 7 |
---
|
| 8 |
|
| 9 |
+
# Tokenizer Fixed!! 🎉
|
| 10 |
+
Thanks to https://huggingface.co/mistralai/Mistral-7B-v0.1/discussions/26/files
|
| 11 |
+
|
| 12 |
+
|
| 13 |
# OpenLLaMA: An Open Reproduction of LLaMA
|
| 14 |
|
| 15 |
**TL;DR**: we are releasing our public preview of OpenLLaMA, a permissively licensed open source reproduction of Meta AI’s LLaMA. We are releasing a series of 3B, 7B and 13B models trained on different data mixtures. Our model weights can serve as the drop in replacement of LLaMA in existing implementations.
|
|
|
|
| 28 |
import torch
|
| 29 |
from transformers import LlamaTokenizer, LlamaForCausalLM
|
| 30 |
|
| 31 |
+
model_path = 'typeof/open_llama_3b_v2'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
tokenizer = LlamaTokenizer.from_pretrained(model_path)
|
| 34 |
model = LlamaForCausalLM.from_pretrained(
|