Instructions to use miulab/llama2-7b-oss-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use miulab/llama2-7b-oss-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="miulab/llama2-7b-oss-instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("miulab/llama2-7b-oss-instruct") model = AutoModelForCausalLM.from_pretrained("miulab/llama2-7b-oss-instruct", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use miulab/llama2-7b-oss-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "miulab/llama2-7b-oss-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "miulab/llama2-7b-oss-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/miulab/llama2-7b-oss-instruct
- SGLang
How to use miulab/llama2-7b-oss-instruct 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 "miulab/llama2-7b-oss-instruct" \ --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": "miulab/llama2-7b-oss-instruct", "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 "miulab/llama2-7b-oss-instruct" \ --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": "miulab/llama2-7b-oss-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use miulab/llama2-7b-oss-instruct with Docker Model Runner:
docker model run hf.co/miulab/llama2-7b-oss-instruct
|
Download README.md from miulab/llama2-7b-oss-instruct: direct link, hf CLI and curl.
- Browser
- Download file 850 Bytes
-
https://huggingface.co/miulab/llama2-7b-oss-instruct/resolve/main/README.md
- Command line
-
hf download hf://miulab/llama2-7b-oss-instruct/README.md
-
curl -L -o README.md https://huggingface.co/miulab/llama2-7b-oss-instruct/resolve/main/README.md
850 Bytes
metadata
library_name: transformers
license: apache-2.0
datasets:
- ise-uiuc/Magicoder-OSS-Instruct-75K
language:
- en
base_model:
- meta-llama/Llama-2-7b-hf
pipeline_tag: text-generation
This is the backbone of our "the Code model" used in the paper "DogeRM: Equipping Reward Models with Domain Knowledge through Model Merging".
The detailed training/evaluation information can be found at https://api.wandb.ai/links/merge_exp/jhdkzbi2.
For more details about this model, please refer to our paper.
If you found this model useful, please cite our paper:
@article{lin2024dogerm,
title={DogeRM: Equipping Reward Models with Domain Knowledge through Model Merging},
author={Lin, Tzu-Han and Li, Chen-An and Lee, Hung-yi and Chen, Yun-Nung},
journal={arXiv preprint arXiv:2407.01470},
year={2024}
}