Instructions to use Trelis/Yi-6B-200K-Llamafied-chat-SFT-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Trelis/Yi-6B-200K-Llamafied-chat-SFT-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Trelis/Yi-6B-200K-Llamafied-chat-SFT-AWQ")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Trelis/Yi-6B-200K-Llamafied-chat-SFT-AWQ") model = AutoModelForCausalLM.from_pretrained("Trelis/Yi-6B-200K-Llamafied-chat-SFT-AWQ", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Trelis/Yi-6B-200K-Llamafied-chat-SFT-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Trelis/Yi-6B-200K-Llamafied-chat-SFT-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Trelis/Yi-6B-200K-Llamafied-chat-SFT-AWQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Trelis/Yi-6B-200K-Llamafied-chat-SFT-AWQ
- SGLang
How to use Trelis/Yi-6B-200K-Llamafied-chat-SFT-AWQ 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 "Trelis/Yi-6B-200K-Llamafied-chat-SFT-AWQ" \ --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": "Trelis/Yi-6B-200K-Llamafied-chat-SFT-AWQ", "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 "Trelis/Yi-6B-200K-Llamafied-chat-SFT-AWQ" \ --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": "Trelis/Yi-6B-200K-Llamafied-chat-SFT-AWQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Trelis/Yi-6B-200K-Llamafied-chat-SFT-AWQ with Docker Model Runner:
docker model run hf.co/Trelis/Yi-6B-200K-Llamafied-chat-SFT-AWQ
EOS fine-tuning
Have the Yi 6B/34B models been fine-tuned to use EOS properly up to the 200k context length?
Did you use a fine-tuning dataset with long enough example to achieve that?
How did you test the quality of the context and that the model properly using EOS up to 200k context lengths? Any results?
Did you use PEFT or full fine-tuning? Same for 6B and 34B?
Howdy!
Here is the video to check out: https://www.youtube.com/watch?v=71x8EMrB0Gc
I use PEFT training (bf16), but with the addition of making embed and norm modules trainable as well. This allows the model to get the chat format and get the EOS token correct. Alternatively, you could do full fine tuning, but typically that is less stable and much slower to get the same results.
As you will see in the video, the 6B model does not perform well responding with text after about 15 to 20,000 tokens. However, the larger 34B model does achieve good responses - even for 100K+ contexts. This is despite the fine tuning I did which involved only 4000 token context.