Instructions to use allenai/open-instruct-gpt4-alpaca-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use allenai/open-instruct-gpt4-alpaca-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="allenai/open-instruct-gpt4-alpaca-7b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("allenai/open-instruct-gpt4-alpaca-7b") model = AutoModelForCausalLM.from_pretrained("allenai/open-instruct-gpt4-alpaca-7b") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use allenai/open-instruct-gpt4-alpaca-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "allenai/open-instruct-gpt4-alpaca-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "allenai/open-instruct-gpt4-alpaca-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/allenai/open-instruct-gpt4-alpaca-7b
- SGLang
How to use allenai/open-instruct-gpt4-alpaca-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 "allenai/open-instruct-gpt4-alpaca-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": "allenai/open-instruct-gpt4-alpaca-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 "allenai/open-instruct-gpt4-alpaca-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": "allenai/open-instruct-gpt4-alpaca-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use allenai/open-instruct-gpt4-alpaca-7b with Docker Model Runner:
docker model run hf.co/allenai/open-instruct-gpt4-alpaca-7b
reproducing experiment, looking for some help or advise
hi guys, amazing work from an amazing lab.
I am working on a paper, looking to reproduce some causal modeling experiment and I saw the massive amount of score marks provided in the paper of this model, but i cant find the hyperparameters and some material needed to reproduce it exactly.
Can you give me a hand to reproduce this or another from ur collections that you know/had made before and its a good empirical evidence for contrasting an llm performance so we can reproduce & reference & cite ?
much appreciated, thanks!
Hi! We provide information on replicating the experiments here: https://github.com/allenai/open-instruct/blob/main/docs/tulu1_tulu2.md (note that you need to use an earlier commit of open-instruct for this, since this is older work). I would recommend looking also at our Tulu 3 models (https://huggingface.co/collections/allenai/tulu-3-models-673b8e0dc3512e30e7dc54f5, paper: https://arxiv.org/abs/2411.15124), which are our latest and best sets of models and experiments, with fully open recipes and data for replication.