Instructions to use OptimalScale/robin-13b-v2-delta with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OptimalScale/robin-13b-v2-delta with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OptimalScale/robin-13b-v2-delta")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OptimalScale/robin-13b-v2-delta") model = AutoModelForCausalLM.from_pretrained("OptimalScale/robin-13b-v2-delta") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OptimalScale/robin-13b-v2-delta with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OptimalScale/robin-13b-v2-delta" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OptimalScale/robin-13b-v2-delta", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OptimalScale/robin-13b-v2-delta
- SGLang
How to use OptimalScale/robin-13b-v2-delta 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 "OptimalScale/robin-13b-v2-delta" \ --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": "OptimalScale/robin-13b-v2-delta", "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 "OptimalScale/robin-13b-v2-delta" \ --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": "OptimalScale/robin-13b-v2-delta", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OptimalScale/robin-13b-v2-delta with Docker Model Runner:
docker model run hf.co/OptimalScale/robin-13b-v2-delta
output gibberish
Downloaded this 13b weights, loaded and run successfully, just that the outputs are gibberish. Not sure if it is my weights corrupted or what. Anyone sees this, or anyone is successful? thanks.
Hi,
robin-delta-v2 is a delta model, which means you need to merge it with the base model (i.e., LLaMA-13B).
The merge script could be found at https://github.com/OptimalScale/LMFlow#53-reproduce-the-result
python utils/apply_delta.py \
--base-model-path {huggingface-model-name-or-path-to-base-model} \
--delta-path {path-to-delta-model} \
--target-model-path {path-to-merged-model}
thanks! it works.
btw, does the generation require "#" as eos_token to terminate? just ant to bring this up: I think vicuna v2 fixed a similar issue by re-training using "" to replace "###", wonder if it is similar cause.
yes, robin models use "###" as eos_token to terminate.
I do not fully understand what is the issue/consequence of using "#" you mentioned. Could you elaborate more?
Thanks!
yes, robin models use "###" as eos_token to terminate.
I do not fully understand what is the issue/consequence of using "#" you mentioned. Could you elaborate more?
Thanks!
Is Robin-7B-v2 a base model or a model that has learned eos_token through SFT? I tired to set eos_token = '###' in tokenizer, also I used
model.generate(inputs, eos_token_id= tokenizer.eos_token_id, max_length=512)
BUT it does not stop at eos_token, instead continues until the maximum length.
Hi, it is a model after SFT. the stop token is '###'
As for inference, you can take a look at our doc https://github.com/OptimalScale/LMFlow
Thanks