kitkatstftwafw commited on
Commit
af1b4a2
·
verified ·
1 Parent(s): 15a473e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +97 -2
README.md CHANGED
@@ -5,9 +5,104 @@ language:
5
  library_name: transformers
6
  tags:
7
  - tinyllama
8
- - discord
9
  - chat
10
  - fine-tuned
11
  - text-generation
12
  - peft
13
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  library_name: transformers
6
  tags:
7
  - tinyllama
 
8
  - chat
9
  - fine-tuned
10
  - text-generation
11
  - peft
12
+ ---
13
+
14
+ # TinyPi-Chat-V1
15
+
16
+ TinyPi-Chat-V1 is a fine-tuned version of the `TinyLlama/TinyLlama-1.1B-Chat-v1.0` model. This project's goal was not to create a simple instruction-following assistant, but to cultivate an AI with a distinct, friendly, and engaging personality, mirroring the natural, witty, and sometimes quirky style of general-purpose Discord conversations.
17
+
18
+ The model, which has named itself "Kat," demonstrates a unique persona that is both conversational and capable of surprisingly deep, philosophical exchanges. It was trained on a large dataset of chat logs, resulting in a model that excels at open-ended conversation, offers playful and sometimes evasive humor, and can maintain a consistent character.
19
+
20
+ This version (v1) represents the initial, highly specialized fine-tune and serves as the foundation for further alignment using techniques like RLAIF.
21
+
22
+ ## How to Use
23
+
24
+ This model is a merged, standalone model and can be used directly for text generation. It follows a specific chat template that must be used to get the best results.
25
+
26
+ ### Installation
27
+
28
+ ```bash
29
+ pip install transformers torch accelerate
30
+ ```
31
+
32
+ ```Python
33
+ from transformers import pipeline
34
+ import torch
35
+
36
+ model_path = "Kittykat924/TinyPi-chat-V1"
37
+ pipe = pipeline(
38
+ "text-generation",
39
+ model=model_path,
40
+ torch_dtype=torch.float16,
41
+ device_map="auto"
42
+ )
43
+
44
+ prompt = "What do you think of today?"
45
+ system_instruction = "You are a helpful and friendly AI assistant with a slightly feminine and humorous personality."
46
+
47
+ messages = [
48
+ {"role": "system", "content": system_instruction},
49
+ {"role": "user", "content": prompt},
50
+ ]
51
+
52
+ prompt_formatted = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
53
+
54
+ outputs = pipe(
55
+ prompt_formatted,
56
+ max_new_tokens=128,
57
+ do_sample=True,
58
+ temperature=0.7,
59
+ top_k=50,
60
+ top_p=0.95
61
+ )
62
+
63
+ response = outputs[0]["generated_text"]
64
+ assistant_response = response.split("<|assistant|>")[1].strip()
65
+ print(assistant_response)
66
+ ```
67
+ # Training Procedure
68
+
69
+ This model was trained using a custom script built on the Hugging Face accelerate, peft, and datasets libraries.
70
+ # v1 Fine-tuning Details
71
+
72
+ Base Model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
73
+
74
+ Dataset: A large, private dataset of over 2 million general-purpose Discord chat messages.
75
+
76
+ Training Method: Parameter-Efficient Fine-Tuning (PEFT) using the LoRA technique.
77
+
78
+ Hardware: 2x NVIDIA T4 GPUs on Kaggle.
79
+
80
+ Framework: accelerate for distributed training.
81
+ # Key Hyperparameters:
82
+
83
+ Learning Rate: 2e-4
84
+
85
+ LoRA r (rank): 64
86
+
87
+ LoRA alpha: 16
88
+
89
+ Batch Size: 4 per device
90
+
91
+ Gradient Accumulation: 4 steps
92
+
93
+ Optimizer: AdamW
94
+
95
+ The model was trained for approximately 2500 steps, with the final adapter chosen based on the lowest validation loss, which occurred very early in the training process (around step 200), indicating rapid specialization on the dataset. The final merged model uses the weights from this optimal checkpoint.
96
+
97
+ # Project Goals
98
+
99
+ The primary goal of this project was to explore the emergence of personality in language models. Instead of optimizing for factual accuracy or instruction-following, the training was designed to capture the nuances of human-to-human digital interaction. The success of this v1 model lies in its ability to generate responses that are not just correct but believable and in-character.
100
+
101
+ The "weirdness" and occasional abstract responses are not viewed as bugs, but as features of a model that has learned a rich but ungrounded set of conversational styles.
102
+
103
+ # Limitations and Bias
104
+
105
+ This model was trained on a large corpus of public internet chat data. As such, it may have inherited biases, opinions, and language styles present in that data. It is not designed to be a source of factual information and may produce incorrect or nonsensical statements, especially on topics outside its training domain. It is intended for research and entertainment purposes. User discretion is advised.
106
+
107
+
108
+ -*kittykat924*