PingVortex commited on
Commit
82e75bb
·
verified ·
1 Parent(s): 0eff4a5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +104 -3
README.md CHANGED
@@ -1,3 +1,104 @@
1
- ---
2
- license: apache-2.0
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
+ [![Discord](https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=white)](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).*