How to use from
vLLM
Install from pip and serve model
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "TinyPixel/stablelm-ft2"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "TinyPixel/stablelm-ft2",
		"prompt": "Once upon a time,",
		"max_tokens": 512,
		"temperature": 0.5
	}'
Use Docker
docker model run hf.co/TinyPixel/stablelm-ft2
Quick Links

Usage:

from transformers import AutoModelForCausalLM, AutoTokenizer

import torch

tokenizer = AutoTokenizer.from_pretrained("TinyPixel/stablelm-ft2", trust_remote_code=True)

model = AutoModelForCausalLM.from_pretrained("TinyPixel/stablelm-ft2", torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True)

text = '''### System:
You are a helpful AI assistant. 

### User:
Why is sky blue?

### Assistant:
'''

device = "cuda:0" 

inputs = tokenizer(text, return_tensors="pt").to(device)

outputs = model.generate(**inputs,  
                          max_new_tokens=512,
                          do_sample=True,
                          top_p=0.95,
                          temperature=0.7,
                          top_k=50)

print(tokenizer.decode(outputs[0], skip_special_tokens=False))
Downloads last month
9
Safetensors
Model size
3B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train TinyPixel/stablelm-ft2