Instructions to use vilm/vulture-40b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vilm/vulture-40b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vilm/vulture-40b", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("vilm/vulture-40b", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use vilm/vulture-40b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vilm/vulture-40b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vilm/vulture-40b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/vilm/vulture-40b
- SGLang
How to use vilm/vulture-40b 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 "vilm/vulture-40b" \ --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": "vilm/vulture-40b", "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 "vilm/vulture-40b" \ --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": "vilm/vulture-40b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use vilm/vulture-40b with Docker Model Runner:
docker model run hf.co/vilm/vulture-40b
Code don't run
i can't give you any advice without seeing your current code
i can't give you any advice without seeing your current code
i use code example
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch
model = "vilm/vulture-40B"
tokenizer = AutoTokenizer.from_pretrained(model)
m = AutoModelForCausalLM.from_pretrained(model, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True )
prompt = "A chat between a curious user and an artificial intelligence assistant.\n\nUSER:Thành phố Hồ Chí Minh nằm ở đâu?<|endoftext|>ASSISTANT:"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
output = m.generate(input_ids=inputs["input_ids"],
attention_mask=inputs["attention_mask"],
do_sample=True,
temperature=0.6,
top_p=0.9,
max_new_tokens=50,)
output = output[0].to("cpu")
print(tokenizer.decode(output))
i can't give you any advice without seeing your current code
i use code example
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torchmodel = "vilm/vulture-40B"
tokenizer = AutoTokenizer.from_pretrained(model)
m = AutoModelForCausalLM.from_pretrained(model, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True )prompt = "A chat between a curious user and an artificial intelligence assistant.\n\nUSER:Thành phố Hồ Chí Minh nằm ở đâu?<|endoftext|>ASSISTANT:"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
output = m.generate(input_ids=inputs["input_ids"],
attention_mask=inputs["attention_mask"],
do_sample=True,
temperature=0.6,
top_p=0.9,
max_new_tokens=50,)
output = output[0].to("cpu")
print(tokenizer.decode(output))
Can you give us more details on your hardware configuration and the status of your CPU or GPU when you run the code?
i can't give you any advice without seeing your current code
i use code example
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torchmodel = "vilm/vulture-40B"
tokenizer = AutoTokenizer.from_pretrained(model)
m = AutoModelForCausalLM.from_pretrained(model, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True )prompt = "A chat between a curious user and an artificial intelligence assistant.\n\nUSER:Thành phố Hồ Chí Minh nằm ở đâu?<|endoftext|>ASSISTANT:"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
output = m.generate(input_ids=inputs["input_ids"],
attention_mask=inputs["attention_mask"],
do_sample=True,
temperature=0.6,
top_p=0.9,
max_new_tokens=50,)
output = output[0].to("cpu")
print(tokenizer.decode(output))Can you give us more details on your hardware configuration and the status of your CPU or GPU when you run the code?
i can't give you any advice without seeing your current code
i use code example
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torchmodel = "vilm/vulture-40B"
tokenizer = AutoTokenizer.from_pretrained(model)
m = AutoModelForCausalLM.from_pretrained(model, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True )prompt = "A chat between a curious user and an artificial intelligence assistant.\n\nUSER:Thành phố Hồ Chí Minh nằm ở đâu?<|endoftext|>ASSISTANT:"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
output = m.generate(input_ids=inputs["input_ids"],
attention_mask=inputs["attention_mask"],
do_sample=True,
temperature=0.6,
top_p=0.9,
max_new_tokens=50,)
output = output[0].to("cpu")
print(tokenizer.decode(output))Can you give us more details on your hardware configuration and the status of your CPU or GPU when you run the code?
Hi, I believe you will need more than 24GB of VRAM to do inference on 40B. Maybe try load_in_4bits=True, I do not know how much quantization will help as I have not tried it yet!
i can't give you any advice without seeing your current code
i use code example
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torchmodel = "vilm/vulture-40B"
tokenizer = AutoTokenizer.from_pretrained(model)
m = AutoModelForCausalLM.from_pretrained(model, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True )prompt = "A chat between a curious user and an artificial intelligence assistant.\n\nUSER:Thành phố Hồ Chí Minh nằm ở đâu?<|endoftext|>ASSISTANT:"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
output = m.generate(input_ids=inputs["input_ids"],
attention_mask=inputs["attention_mask"],
do_sample=True,
temperature=0.6,
top_p=0.9,
max_new_tokens=50,)
output = output[0].to("cpu")
print(tokenizer.decode(output))Can you give us more details on your hardware configuration and the status of your CPU or GPU when you run the code?
Hi, I believe you will need more than 24GB of VRAM to do inference on 40B. Maybe try
load_in_4bits=True, I do not know how much quantization will help as I have not tried it yet!
You don't understand what I mean, what I mean is that the model loads normally, but when running, it freezes and nothing appears. Your entire code is missing a parameter, trust_remote_code=True, which when using your code then RWForCausalLM cannot use load_in_4bits ? I don't know if your side is mistaken somewhere :((

