Instructions to use OpenBuddy/openbuddy-llama2-13b-v8.1-fp16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenBuddy/openbuddy-llama2-13b-v8.1-fp16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpenBuddy/openbuddy-llama2-13b-v8.1-fp16")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OpenBuddy/openbuddy-llama2-13b-v8.1-fp16") model = AutoModelForCausalLM.from_pretrained("OpenBuddy/openbuddy-llama2-13b-v8.1-fp16", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenBuddy/openbuddy-llama2-13b-v8.1-fp16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenBuddy/openbuddy-llama2-13b-v8.1-fp16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenBuddy/openbuddy-llama2-13b-v8.1-fp16", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OpenBuddy/openbuddy-llama2-13b-v8.1-fp16
- SGLang
How to use OpenBuddy/openbuddy-llama2-13b-v8.1-fp16 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 "OpenBuddy/openbuddy-llama2-13b-v8.1-fp16" \ --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": "OpenBuddy/openbuddy-llama2-13b-v8.1-fp16", "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 "OpenBuddy/openbuddy-llama2-13b-v8.1-fp16" \ --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": "OpenBuddy/openbuddy-llama2-13b-v8.1-fp16", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OpenBuddy/openbuddy-llama2-13b-v8.1-fp16 with Docker Model Runner:
docker model run hf.co/OpenBuddy/openbuddy-llama2-13b-v8.1-fp16
最好能给出Instruction模板和示例,另外请问底层是llama2-base还是llama2-chat?
方便没加群的上手测试。
我试过
User:
Assistant:
这样可以,比较奇特的是直接调用
You are .... assistant. Think it over and answer user question correctly.
User:
Assistant:
可以,但是用ooba ui + extllama加载后,api调用时,却需要
User: You are .... assistant. Think it over and answer user question correctly. \n
Assistant:
这样才行。
同时做领域finetune测试时,发现上述对话格式做模板 loss下降很慢,如果换成llama2的instruction模板,就是带
的那个,loss下降快很多。
你好,Instruction模板和示例请参考我们的Github上的example:https://github.com/OpenBuddy/OpenBuddy/blob/main/examples/hello.py
sft的时候,System Prompt只需You are a helpful assistant.
另外,底层是llama2-base