HuggingFaceTB/everyday-conversations-llama3.1-2k
Viewer • Updated • 2.38k • 1.57k • 130
How to use pvlabs/Chytrej2-Mini-It with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="pvlabs/Chytrej2-Mini-It") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("pvlabs/Chytrej2-Mini-It")
model = AutoModelForCausalLM.from_pretrained("pvlabs/Chytrej2-Mini-It")How to use pvlabs/Chytrej2-Mini-It with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "pvlabs/Chytrej2-Mini-It"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "pvlabs/Chytrej2-Mini-It",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/pvlabs/Chytrej2-Mini-It
How to use pvlabs/Chytrej2-Mini-It with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "pvlabs/Chytrej2-Mini-It" \
--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": "pvlabs/Chytrej2-Mini-It",
"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 "pvlabs/Chytrej2-Mini-It" \
--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": "pvlabs/Chytrej2-Mini-It",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use pvlabs/Chytrej2-Mini-It with Docker Model Runner:
docker model run hf.co/pvlabs/Chytrej2-Mini-It
A fine-tuned version of Chytrej2-Mini (20M params, LLaMA architecture) trained on conversational data. Don't expect great answers.
Built by PingVortex Labs.
Fine-tuned on HuggingFaceTB/everyday-conversations-llama3.1-2k dataset.
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_path = "pvlabs/Chytrej2-Mini-It"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(model_path, dtype=torch.float16)
model.eval()
prompt = "<|im_start|>user\nHello<|im_end|>\n<|im_start|>assistant\n"
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
output = model.generate(
**inputs,
max_new_tokens=200,
do_sample=True,
temperature=0.7,
top_p=0.9,
eos_token_id=tokenizer.convert_tokens_to_ids("<|im_end|>"),
pad_token_id=tokenizer.eos_token_id,
)
generated = tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False)
print(generated)
The model uses the standard ChatML format:
<|im_start|>user
Your message here<|im_end|>
<|im_start|>assistant
For multi-turn, chain turns:
<|im_start|>user
Hi!<|im_end|>
<|im_start|>assistant
Hello! How can I help you today?<|im_end|>
<|im_start|>user
What's 2+2?<|im_end|>
<|im_start|>assistant
Made by PingVortex.
Base model
pvlabs/Chytrej2-Mini