Instructions to use GreenBitAI/yi-34b-w4a16g32 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GreenBitAI/yi-34b-w4a16g32 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="GreenBitAI/yi-34b-w4a16g32")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("GreenBitAI/yi-34b-w4a16g32") model = AutoModelForCausalLM.from_pretrained("GreenBitAI/yi-34b-w4a16g32", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use GreenBitAI/yi-34b-w4a16g32 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GreenBitAI/yi-34b-w4a16g32" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GreenBitAI/yi-34b-w4a16g32", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/GreenBitAI/yi-34b-w4a16g32
- SGLang
How to use GreenBitAI/yi-34b-w4a16g32 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 "GreenBitAI/yi-34b-w4a16g32" \ --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": "GreenBitAI/yi-34b-w4a16g32", "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 "GreenBitAI/yi-34b-w4a16g32" \ --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": "GreenBitAI/yi-34b-w4a16g32", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use GreenBitAI/yi-34b-w4a16g32 with Docker Model Runner:
docker model run hf.co/GreenBitAI/yi-34b-w4a16g32
200k model
One application of quantized models I'm interested in is long context inference. Will you make a 2 bit Yi-34b-200k?
I think that would be great for few shot learning over long contexts!
Thanks for your continuous attention to this work. The long-context model is in the plan and by now we pay more attention to the lossless (<1%) quantization under lower bits (e.g., 2-bit, which is already quite close to our expectation). Once we reach that point, we will release more compressed models to the community step by step.
If you can share some meaningful metrics about how can we measure the performance of "lossless" compressed long-context models, that would be ultra helpful for our current research, thanks.
I can refer you to the works on long context window LLMs that are already around.
Yarn uses perplexity and compares the perplexity of different models at different context lengths:
https://huggingface.co/NousResearch/Yarn-Llama-2-70b-32k
Giraffe makes use of several QA benchmarks:
https://github.com/abacusai/long-context
longllama assesses improvement as passkey retrieval, QA over research papers and the improvement in few shot learning from using longer context few shot instances:
https://huggingface.co/syzymon/long_llama_3b
longlora additionally uses topic retrieval over long contexts as evaluation