Instructions to use NewstaR/OpenSparrow-1.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NewstaR/OpenSparrow-1.5B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NewstaR/OpenSparrow-1.5B", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("NewstaR/OpenSparrow-1.5B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use NewstaR/OpenSparrow-1.5B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NewstaR/OpenSparrow-1.5B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NewstaR/OpenSparrow-1.5B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/NewstaR/OpenSparrow-1.5B
- SGLang
How to use NewstaR/OpenSparrow-1.5B 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 "NewstaR/OpenSparrow-1.5B" \ --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": "NewstaR/OpenSparrow-1.5B", "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 "NewstaR/OpenSparrow-1.5B" \ --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": "NewstaR/OpenSparrow-1.5B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use NewstaR/OpenSparrow-1.5B with Docker Model Runner:
docker model run hf.co/NewstaR/OpenSparrow-1.5B
OpenSparrow uses the:
GPT Prompt Template:
OpenSparrow-1.5b can be used with the GPT prompt template to generate text in a variety of styles, including factual, creative, and informative. To use the GPT prompt template, simply provide the model with the following information:
<sys>: The system prompt. This tells the model what its role is, how it should respond, and its traits.
[P] and [R]: The prompt and response. The prompt is the text that the model is given to generate text from. The response is the text that the model generates.
Here is an example of a GPT prompt using the template:
<sys> You are a helpful assistant. </sys> [P] Hi! [R] Hello! I'm Sparrow, an AI assistant. I can answer your questions, tell you about interesting things, and chat with you. I was trained to be respectful, polite and inclusive.
- Downloads last month
- 19