Instructions to use emozilla/open_llama_7b-scaled with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use emozilla/open_llama_7b-scaled with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="emozilla/open_llama_7b-scaled", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("emozilla/open_llama_7b-scaled", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("emozilla/open_llama_7b-scaled", trust_remote_code=True) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use emozilla/open_llama_7b-scaled with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "emozilla/open_llama_7b-scaled" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "emozilla/open_llama_7b-scaled", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/emozilla/open_llama_7b-scaled
- SGLang
How to use emozilla/open_llama_7b-scaled 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 "emozilla/open_llama_7b-scaled" \ --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": "emozilla/open_llama_7b-scaled", "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 "emozilla/open_llama_7b-scaled" \ --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": "emozilla/open_llama_7b-scaled", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use emozilla/open_llama_7b-scaled with Docker Model Runner:
docker model run hf.co/emozilla/open_llama_7b-scaled
Very nice!
This is awesome. I actually pinged @kaiokendev recently to ask if he could implement his code as a config.json patch activated by trust_remote_code=True. I didn't see that you'd already done it!
I just wanted to check: this model is not re-trained for context, correct? It's the same as Open Llama 7B base model, but with the ROPE code added so it could be used as a basis for further training with increased context? My understanding is that the code will work without re-training the model, but that responses are much improved by applying increased-context training on top?
Great work, @emozilla and @kaiokendev !
Yup, this is fully inference only -- exactly equivalent model weights. I haven't tried fine-tuning with this (yet) but the fact that it works /at all/ without fine-tuning suggests it should work much better after some extra training