Instructions to use LSX-UniWue/LLaMmlein_1B_prerelease with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LSX-UniWue/LLaMmlein_1B_prerelease with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LSX-UniWue/LLaMmlein_1B_prerelease")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LSX-UniWue/LLaMmlein_1B_prerelease") model = AutoModelForCausalLM.from_pretrained("LSX-UniWue/LLaMmlein_1B_prerelease") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use LSX-UniWue/LLaMmlein_1B_prerelease with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LSX-UniWue/LLaMmlein_1B_prerelease" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LSX-UniWue/LLaMmlein_1B_prerelease", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/LSX-UniWue/LLaMmlein_1B_prerelease
- SGLang
How to use LSX-UniWue/LLaMmlein_1B_prerelease 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 "LSX-UniWue/LLaMmlein_1B_prerelease" \ --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": "LSX-UniWue/LLaMmlein_1B_prerelease", "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 "LSX-UniWue/LLaMmlein_1B_prerelease" \ --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": "LSX-UniWue/LLaMmlein_1B_prerelease", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use LSX-UniWue/LLaMmlein_1B_prerelease with Docker Model Runner:
docker model run hf.co/LSX-UniWue/LLaMmlein_1B_prerelease
Issue with Vocabulary Size Mismatch in all LLaMmlein_1B_chat_ peft adapters
Dear LSX-UniWue Team,
First of all, thank you for providing the LLaMmlein models and their adapters!
While trying to integrate the LLaMmlein_1B_chat_x adapter with the base model LLaMmlein_1b, I encountered a size mismatch error related to the embedding layer and output head.
Specifically, the error occurs due to a difference in vocabulary size:
The base model's vocabulary size is 32,000,
While the adapter expects a vocabulary size of 32,064.
Here’s the relevant error snippet:
RuntimeError: Error(s) in loading state_dict for PeftModelForCausalLM:
size mismatch for base_model.model.model.embed_tokens.weight: copying a param with shape torch.Size([32064, 2048]) from checkpoint, the shape in current model is torch.Size([32000, 2048]).
size mismatch for base_model.model.lm_head.weight: copying a param with shape torch.Size([32064, 2048]) from checkpoint, the shape in current model is torch.Size([32000, 2048]).
I suspect this might be due to a discrepancy in the tokenizers or vocabulary configurations used when training the adapter. Could you clarify if there’s a specific tokenizer or additional steps required to align the base model with the adapter?
Alternatively, is it intentional that the adapter has a larger vocabulary size, and if so, what would be the recommended method to handle this mismatch?
Thank you for your time and support. I look forward to your guidance on resolving this issue.
Best regards,
David
Hey David,
you are absolutely right, in the heat of the release we forgot to add an inference script. I just added them to the readmes of the instruct adapters!
Best,
jan