NovaAI6868 commited on
Commit
965d73d
·
verified ·
1 Parent(s): 025ef7f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +123 -0
README.md CHANGED
@@ -1,4 +1,127 @@
1
  # NovaAI-0.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  ---
3
  license: mit
4
  ---
 
1
  # NovaAI-0.1
2
+
3
+ # Chinese QA GPT Model
4
+
5
+ ## Model Description
6
+
7
+ This is a Chinese language GPT-like transformer model trained on question-answering pairs. The model is designed to generate helpful, conversational responses to user questions in Chinese. It uses a decoder-only architecture similar to GPT with causal self-attention and is optimized for Chinese language understanding and generation.
8
+
9
+ ## Model Details
10
+
11
+ - **Architecture**: Decoder-only Transformer (GPT-like)
12
+ - **Parameters**: ~124M parameters (configurable)
13
+ - **Vocabulary Size**: 32,000 (SentencePiece BPE)
14
+ - **Context Length**: 1,024 tokens
15
+ - **Language**: Chinese (Simplified)
16
+ - **Task**: Question Answering / Conversational AI
17
+
18
+ ## Model Architecture
19
+
20
+ The model consists of:
21
+ - **12 Transformer layers** with causal self-attention
22
+ - **12 attention heads** per layer
23
+ - **768-dimensional embeddings**
24
+ - **SentencePiece tokenizer** with BPE encoding for Chinese text
25
+ - **GELU activation functions**
26
+ - **Layer normalization** and residual connections
27
+
28
+ ## Training Data
29
+
30
+ The model was trained on a diverse dataset of Chinese question-answering pairs covering various topics including:
31
+ - Gaming and entertainment
32
+ - Technology and gadgets
33
+ - Health and lifestyle
34
+ - Travel and local recommendations
35
+ - Relationships and social advice
36
+ - General knowledge questions
37
+
38
+ ## Training Configuration
39
+
40
+ - **Training Method**: Causal Language Modeling (next token prediction)
41
+ - **Batch Size**: 4
42
+ - **Learning Rate**: 3e-4 (AdamW optimizer)
43
+ - **Epochs**: 3
44
+ - **Dropout**: 0.1
45
+ - **Gradient Clipping**: 1.0
46
+
47
+ ## Usage
48
+
49
+ ### Installation
50
+ ```bash
51
+ pip install torch sentencepiece tqdm
52
+ ```
53
+
54
+ ### Training
55
+ ```bash
56
+ python train.py --data_path all.jsonl --spm_model spm.model
57
+ ```
58
+
59
+ ### Inference
60
+ ```bash
61
+ python infer.py --checkpoint checkpoints/checkpoint_epoch3.pt --spm_model spm.model --prompt "你的问题"
62
+ ```
63
+
64
+ ### Python API
65
+ ```python
66
+ import torch
67
+ import sentencepiece as spm
68
+ from train import GPT, GPTConfig
69
+
70
+ # Load model
71
+ sp = spm.SentencePieceProcessor()
72
+ sp.Load('spm.model')
73
+
74
+ checkpoint = torch.load('checkpoints/checkpoint_epoch3.pt')
75
+ config = GPTConfig(
76
+ vocab_size=32000,
77
+ n_layer=12,
78
+ n_head=12,
79
+ n_embd=768,
80
+ block_size=1024
81
+ )
82
+ model = GPT(config)
83
+ model.load_state_dict(checkpoint['model_state'])
84
+
85
+ # Generate response
86
+ prompt = "你好,请介绍一下你自己"
87
+ ids = sp.EncodeAsIds('<s>' + prompt + '<sep>')
88
+ # ... generation logic
89
+ ```
90
+
91
+ ## Model Performance
92
+
93
+ The model demonstrates strong performance on:
94
+ - Chinese language understanding
95
+ - Contextual question answering
96
+ - Conversational response generation
97
+ - Maintaining coherence over multi-turn conversations
98
+
99
+ ## Limitations
100
+
101
+ - **Language**: Only supports Chinese (Simplified)
102
+ - **Context Window**: Limited to 1,024 tokens
103
+ - **Knowledge Cutoff**: Based on training data timeframe
104
+ - **Factual Accuracy**: May occasionally produce inaccurate information
105
+ - **Bias**: May reflect biases present in training data
106
+
107
+ ## Ethical Considerations
108
+
109
+ This model is designed for educational and research purposes. Users should be aware that:
110
+ - The model may generate responses that seem authoritative but could be factually incorrect
111
+ - The model's training data may contain biases
112
+ - Generated content should be fact-checked before use in critical applications
113
+
114
+ ## Technical Requirements
115
+
116
+ - **Python**: 3.6+
117
+ - **PyTorch**: Latest stable version
118
+ - **CUDA**: Optional, for GPU acceleration
119
+ - **Memory**: ~2GB GPU memory for inference
120
+
121
+ ## License
122
+
123
+ This model is released under the MIT License.
124
+
125
  ---
126
  license: mit
127
  ---