timdettmers/openassistant-guanaco
Viewer โข Updated โข 10.4k โข 14.2k โข 456
How to use aloobun/llama2-7b-guanaco with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="aloobun/llama2-7b-guanaco") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("aloobun/llama2-7b-guanaco")
model = AutoModelForCausalLM.from_pretrained("aloobun/llama2-7b-guanaco", device_map="auto")How to use aloobun/llama2-7b-guanaco with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "aloobun/llama2-7b-guanaco"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "aloobun/llama2-7b-guanaco",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/aloobun/llama2-7b-guanaco
How to use aloobun/llama2-7b-guanaco with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "aloobun/llama2-7b-guanaco" \
--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": "aloobun/llama2-7b-guanaco",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "aloobun/llama2-7b-guanaco" \
--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": "aloobun/llama2-7b-guanaco",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use aloobun/llama2-7b-guanaco with Docker Model Runner:
docker model run hf.co/aloobun/llama2-7b-guanaco
This is a Llama-2-7b-chat-hf model fine-tuned using QLoRA (4-bit precision) on the mlabonne/guanaco-llama2-1k dataset(a subset of OpenAssistant/oasst1).
This model was trained on a single A100.
{'train_runtime': 2368.6484, 'train_samples_per_second': 4.157, 'train_steps_per_second': 1.039, 'train_loss': 1.3207073250405679, 'epoch': 1.0}
This model was finetuned primarily for educational purposes.