Instructions to use compressed-llm/vicuna-13b-v1.3-wanda with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use compressed-llm/vicuna-13b-v1.3-wanda with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="compressed-llm/vicuna-13b-v1.3-wanda")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("compressed-llm/vicuna-13b-v1.3-wanda") model = AutoModelForCausalLM.from_pretrained("compressed-llm/vicuna-13b-v1.3-wanda") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use compressed-llm/vicuna-13b-v1.3-wanda with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "compressed-llm/vicuna-13b-v1.3-wanda" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "compressed-llm/vicuna-13b-v1.3-wanda", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/compressed-llm/vicuna-13b-v1.3-wanda
- SGLang
How to use compressed-llm/vicuna-13b-v1.3-wanda 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 "compressed-llm/vicuna-13b-v1.3-wanda" \ --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": "compressed-llm/vicuna-13b-v1.3-wanda", "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 "compressed-llm/vicuna-13b-v1.3-wanda" \ --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": "compressed-llm/vicuna-13b-v1.3-wanda", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use compressed-llm/vicuna-13b-v1.3-wanda with Docker Model Runner:
docker model run hf.co/compressed-llm/vicuna-13b-v1.3-wanda
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
from transformers import AutoTokenizer, AutoModelForCausalLM, AutoConfig
import torch
model_path = 'efficient-llm/vicuna-13b-v1.3-wanda'
config = AutoConfig.from_pretrained(model_path, revision='0.5_2to4', trust_remote_code=True)
enc = AutoTokenizer.from_pretrained('lmsys/vicuna-13b-v1.3', trust_remote_code=True)
kwargs = {"torch_dtype": torch.float16, "low_cpu_mem_usage": True}
model = AutoModelForCausalLM.from_pretrained(
model_path, config=config, trust_remote_code=True, device_map='auto', revision='0.5_2to4', **kwargs)
model.eval()
input_ids = enc('How are you today?', return_tensors='pt').input_ids.to('cuda')
outputs = model.generate(input_ids=input_ids, max_length=128)
print(enc.decode(outputs[0]))
- Downloads last month
- 3