Text Generation
Transformers
Safetensors
English
llama
causal-lm
finetuned
chytrej
instruct
tiny
chatml
text-generation-inference
Instructions to use pvlabs/Chytrej2-Mini-It with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
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") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use pvlabs/Chytrej2-Mini-It with vLLM:
Install from pip and serve model
# 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 }'Use Docker
docker model run hf.co/pvlabs/Chytrej2-Mini-It
- SGLang
How to use pvlabs/Chytrej2-Mini-It 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 "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 }'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 "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 Model Runner
How to use pvlabs/Chytrej2-Mini-It with Docker Model Runner:
docker model run hf.co/pvlabs/Chytrej2-Mini-It
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,104 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
tags:
|
| 7 |
+
- llama
|
| 8 |
+
- causal-lm
|
| 9 |
+
- finetuned
|
| 10 |
+
- chytrej
|
| 11 |
+
- instruct
|
| 12 |
+
- tiny
|
| 13 |
+
- chatml
|
| 14 |
+
library_name: transformers
|
| 15 |
+
datasets:
|
| 16 |
+
- HuggingFaceTB/everyday-conversations-llama3.1-2k
|
| 17 |
+
base_model: pvlabs/Chytrej2-Mini
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# Chytrej2-Mini-It
|
| 21 |
+
|
| 22 |
+
A fine-tuned version of [Chytrej2-Mini](https://huggingface.co/pvlabs/Chytrej2-Mini) (20M params, LLaMA architecture) trained on conversational data. Don't expect great answers.
|
| 23 |
+
|
| 24 |
+
Built by [PingVortex Labs](https://github.com/PingVortexLabs).
|
| 25 |
+
|
| 26 |
+
[](https://discord.gg/5SzkjVJBs2)
|
| 27 |
+
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
## Model Details
|
| 31 |
+
|
| 32 |
+
+ **Parameters:** 20M
|
| 33 |
+
+ **Context length:** 1024 tokens
|
| 34 |
+
+ **Language:** English only
|
| 35 |
+
+ **Format:** ChatML
|
| 36 |
+
+ **Base model:** [pvlabs/Chytrej2-Mini](https://huggingface.co/pvlabs/Chytrej2-Mini)
|
| 37 |
+
+ **Architecture:** LLaMA
|
| 38 |
+
+ **License:** Apache 2.0
|
| 39 |
+
|
| 40 |
+
---
|
| 41 |
+
|
| 42 |
+
## Training
|
| 43 |
+
|
| 44 |
+
Fine-tuned on [HuggingFaceTB/everyday-conversations-llama3.1-2k](https://huggingface.co/datasets/HuggingFaceTB/everyday-conversations-llama3.1-2k) dataset.
|
| 45 |
+
|
| 46 |
+
---
|
| 47 |
+
|
| 48 |
+
## Usage
|
| 49 |
+
|
| 50 |
+
```python
|
| 51 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 52 |
+
import torch
|
| 53 |
+
|
| 54 |
+
model_path = "pvlabs/Chytrej2-Mini-It"
|
| 55 |
+
|
| 56 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
| 57 |
+
model = AutoModelForCausalLM.from_pretrained(model_path, dtype=torch.float16)
|
| 58 |
+
model.eval()
|
| 59 |
+
|
| 60 |
+
prompt = "<|im_start|>user\nHello<|im_end|>\n<|im_start|>assistant\n"
|
| 61 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 62 |
+
|
| 63 |
+
with torch.no_grad():
|
| 64 |
+
output = model.generate(
|
| 65 |
+
**inputs,
|
| 66 |
+
max_new_tokens=200,
|
| 67 |
+
do_sample=True,
|
| 68 |
+
temperature=0.7,
|
| 69 |
+
top_p=0.9,
|
| 70 |
+
eos_token_id=tokenizer.convert_tokens_to_ids("<|im_end|>"),
|
| 71 |
+
pad_token_id=tokenizer.eos_token_id,
|
| 72 |
+
)
|
| 73 |
+
|
| 74 |
+
generated = tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False)
|
| 75 |
+
print(generated)
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
---
|
| 79 |
+
|
| 80 |
+
## Prompt Format (ChatML)
|
| 81 |
+
|
| 82 |
+
The model uses the standard ChatML format:
|
| 83 |
+
|
| 84 |
+
```
|
| 85 |
+
<|im_start|>user
|
| 86 |
+
Your message here<|im_end|>
|
| 87 |
+
<|im_start|>assistant
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
For multi-turn, chain turns:
|
| 91 |
+
|
| 92 |
+
```
|
| 93 |
+
<|im_start|>user
|
| 94 |
+
Hi!<|im_end|>
|
| 95 |
+
<|im_start|>assistant
|
| 96 |
+
Hello! How can I help you today?<|im_end|>
|
| 97 |
+
<|im_start|>user
|
| 98 |
+
What's 2+2?<|im_end|>
|
| 99 |
+
<|im_start|>assistant
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
---
|
| 103 |
+
|
| 104 |
+
*Made by [PingVortex](https://pingvortex.com).*
|