Instructions to use mgoin/Sheared-LLaMA-1.3B-ds with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mgoin/Sheared-LLaMA-1.3B-ds with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mgoin/Sheared-LLaMA-1.3B-ds")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mgoin/Sheared-LLaMA-1.3B-ds") model = AutoModelForCausalLM.from_pretrained("mgoin/Sheared-LLaMA-1.3B-ds", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mgoin/Sheared-LLaMA-1.3B-ds with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mgoin/Sheared-LLaMA-1.3B-ds" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mgoin/Sheared-LLaMA-1.3B-ds", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mgoin/Sheared-LLaMA-1.3B-ds
- SGLang
How to use mgoin/Sheared-LLaMA-1.3B-ds 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 "mgoin/Sheared-LLaMA-1.3B-ds" \ --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": "mgoin/Sheared-LLaMA-1.3B-ds", "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 "mgoin/Sheared-LLaMA-1.3B-ds" \ --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": "mgoin/Sheared-LLaMA-1.3B-ds", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mgoin/Sheared-LLaMA-1.3B-ds with Docker Model Runner:
docker model run hf.co/mgoin/Sheared-LLaMA-1.3B-ds
https://huggingface.co/princeton-nlp/Sheared-LLaMA-1.3B
from deepsparse import TextGeneration
model = TextGeneration(model="hf:mgoin/Sheared-LLaMA-1.3B-ds")
model("Say hello world in 10 languages:", max_new_tokens=100)
# TextGenerationOutput(created=datetime.datetime(2023, 10, 17, 22, 42, 52, 602506), prompts='Say hello world in 10 languages:', generations=[GeneratedText(text='\nThe world is a big place, and we want to make it a little bit smaller.\nWe’re building a platform that lets you say hello to the world in 10 languages.\nWe’re building a platform that lets you say hello to the world in 10 languages. We’re building a platform that lets you say hello to the world in 10 languages. We’re building a platform that lets you say hello to the world in 10 languages.', score=None, finished=True, finished_reason='length')])
model("Here is a recipe for banana bread:", max_new_tokens=100)
# TextGenerationOutput(created=datetime.datetime(2023, 10, 17, 22, 43, 57, 755015), prompts='Here is a recipe for banana bread:', generations=[GeneratedText(text='a simple, delicious, and healthy way to start your day.\nI’ve been making this banana bread for years. It’s a great way to start your day. It’s easy to make, and it’s delicious.\nI’ve made this banana bread for years. It’s a great way to start your day. It’s easy to make, and it’s delicious.\nI’ve made this banana bread for years', score=None, finished=True, finished_reason='length')])
- Downloads last month
- 9