Instructions to use jerryzh168/llama3-8b-autoquant with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jerryzh168/llama3-8b-autoquant with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jerryzh168/llama3-8b-autoquant")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jerryzh168/llama3-8b-autoquant") model = AutoModelForCausalLM.from_pretrained("jerryzh168/llama3-8b-autoquant") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use jerryzh168/llama3-8b-autoquant with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jerryzh168/llama3-8b-autoquant" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jerryzh168/llama3-8b-autoquant", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/jerryzh168/llama3-8b-autoquant
- SGLang
How to use jerryzh168/llama3-8b-autoquant 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 "jerryzh168/llama3-8b-autoquant" \ --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": "jerryzh168/llama3-8b-autoquant", "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 "jerryzh168/llama3-8b-autoquant" \ --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": "jerryzh168/llama3-8b-autoquant", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use jerryzh168/llama3-8b-autoquant with Docker Model Runner:
docker model run hf.co/jerryzh168/llama3-8b-autoquant
Description
This model is a quantized version for original model "meta-llama/Meta-Llama-3-8B", quantized with torchao's autoquant API. It contains both model weights and compilation artifacts caches that records the itermediate compilation artifacts.
Quantization Details
- Quantization Type: autoquant
- min_sqnr: 20
Usage
You can use this model in your applications by loading it directly from the Hugging Face Hub:
from transformers import AutoModel
model = AutoModel.from_pretrained("jerryzh168/llama3-8b-autoquant")
from huggingface_hub import hf_hub_download
import pickle
hf_hub_download(repo_id="jerryzh168/llama3-8b-autoquant", filename="compile_artifacts.pt2", local_dir="/tmp/")
with open("/tmp/compile_artifacts.pt2", "rb") as f:
artifacts = pickle.load(f)
artifact_bytes, cache_info = artifacts
torch.compiler.load_cache_artifacts(artifact_bytes)
- Downloads last month
- 3