HuggingFaceH4/no_robots
Viewer • Updated • 10k • 9.02k • 546
How to use SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning")
model = AutoModelForCausalLM.from_pretrained("SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning")How to use SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning
How to use SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning" \
--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": "SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning" \
--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": "SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning with Docker Model Runner:
docker model run hf.co/SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning")
model = AutoModelForCausalLM.from_pretrained("SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning")This is Pythia410m-V1-Instruct finetuned on No Robots. This is so it follows system prompts better.
from transformers import pipeline
pipe = pipeline("text-generation", model="SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning")
out= pipe("<|im_start|>system\nYou are a good assistant designed to answer all prompts the user asks.<|im_end|><|im_start|>user\nWhat's the meaning of life?<|im_end|><|im_start|>assistant\n",max_length = 500,repetition_penalty = 1.2, temperature = 0.5, do_sample = True)
print(out[0]["generated_text"])
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SummerSigh/Pythia410m-V1-Instruct-SystemPromptTuning")