Instructions to use daedalus314/Griffin-3B-GPTQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use daedalus314/Griffin-3B-GPTQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="daedalus314/Griffin-3B-GPTQ")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("daedalus314/Griffin-3B-GPTQ") model = AutoModelForCausalLM.from_pretrained("daedalus314/Griffin-3B-GPTQ") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use daedalus314/Griffin-3B-GPTQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "daedalus314/Griffin-3B-GPTQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "daedalus314/Griffin-3B-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/daedalus314/Griffin-3B-GPTQ
- SGLang
How to use daedalus314/Griffin-3B-GPTQ 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 "daedalus314/Griffin-3B-GPTQ" \ --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": "daedalus314/Griffin-3B-GPTQ", "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 "daedalus314/Griffin-3B-GPTQ" \ --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": "daedalus314/Griffin-3B-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use daedalus314/Griffin-3B-GPTQ with Docker Model Runner:
docker model run hf.co/daedalus314/Griffin-3B-GPTQ
Overview
This model is a quantized version of Griffin-3B, using GPTQ. The quantization has been done following the sample notebook provided by Hugging Face.
Usage
The model has been quantized as part of the project GPTStonks. It works with transformers>=4.33.0 and it can run on a consumer GPU, with less than 3GB of GPU RAM. The libraries optimum, auto-gptq, peft and accelerate should also be installed.
Here is a sample code to load the model and run inference with it using sampling as decoding strategy:
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "daedalus314/Griffin-3B-GPTQ"
tokenizer = AutoTokenizer.from_pretrained(model_id)
quant_model = AutoModelForCausalLM.from_pretrained(model_id, device_map='auto')
text = """### HUMAN:
What is artifical intelligence?
### RESPONSE:
"""
inputs = tokenizer(text, return_tensors="pt").to(0)
out = quant_model.generate(
**inputs,
do_sample=True,
top_p=0.9,
temperature=0.9,
max_length=1024,
)
print(tokenizer.decode(out[0], skip_special_tokens=True))
And a sample output:
### HUMAN:
What is artifical intelligence?
### RESPONSE:
Artificial intelligence, or AI, refers to the ability of computers to perform tasks that typically require human intelligence, such as decision making, problem solving, and language understanding. AI has been used in various fields, including healthcare, manufacturing, and finance, among others.
Further details
Please refer to the original model Griffin-3B.
- Downloads last month
- 6