moo100 commited on
Commit
4d93cf4
·
verified ·
1 Parent(s): b9c265d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +42 -106
README.md CHANGED
@@ -9,8 +9,6 @@ tags: []
9
 
10
 
11
 
12
- ## Model Details
13
-
14
  ### Model Description
15
 
16
  <!-- Provide a longer summary of what this model is. -->
@@ -22,12 +20,6 @@ This is the model card of a 🤗 transformers model that has been pushed on the
22
  - **Model type:** Fine-tune-DeepSeek-R1-Distill-Llama-8B
23
  - **License:** MIT License
24
 
25
- ### Model Sources [optional]
26
-
27
-
28
- - **Repository:** [More Information Needed]
29
- - **Paper [optional]:** [More Information Needed]
30
- - **Demo [optional]:** [More Information Needed]
31
 
32
  ## Uses
33
 
@@ -48,39 +40,53 @@ This model is designed for **customer support automation in the telecom industry
48
  - **Developers & data scientists** fine-tuning and deploying the model.
49
  ### Direct Use
50
 
51
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
52
-
53
- [More Information Needed]
54
-
55
- ### Downstream Use [optional]
56
 
57
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
58
-
59
- [More Information Needed]
60
 
61
- ### Out-of-Scope Use
62
 
63
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
 
 
64
 
65
- [More Information Needed]
 
 
66
 
67
- ## Bias, Risks, and Limitations
 
68
 
69
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
 
 
70
 
71
- [More Information Needed]
 
 
72
 
73
- ### Recommendations
 
74
 
75
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
 
76
 
77
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
 
78
 
79
- ## How to Get Started with the Model
 
 
 
 
 
 
 
 
 
80
 
81
- Use the code below to get started with the model.
 
 
82
 
83
- [More Information Needed]
84
 
85
  ## Training Details
86
 
@@ -88,26 +94,20 @@ Use the code below to get started with the model.
88
 
89
  <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
90
 
91
- [More Information Needed]
92
 
93
  ### Training Procedure
94
 
95
  <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
96
 
97
- #### Preprocessing [optional]
 
 
 
98
 
99
- [More Information Needed]
100
-
101
-
102
- #### Training Hyperparameters
103
-
104
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
105
-
106
- #### Speeds, Sizes, Times [optional]
107
-
108
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
109
-
110
- [More Information Needed]
111
 
112
  ## Evaluation
113
 
@@ -141,68 +141,4 @@ Use the code below to get started with the model.
141
 
142
 
143
 
144
- ## Model Examination [optional]
145
-
146
- <!-- Relevant interpretability work for the model goes here -->
147
-
148
- [More Information Needed]
149
-
150
- ## Environmental Impact
151
-
152
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
153
-
154
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
155
-
156
- - **Hardware Type:** [More Information Needed]
157
- - **Hours used:** [More Information Needed]
158
- - **Cloud Provider:** [More Information Needed]
159
- - **Compute Region:** [More Information Needed]
160
- - **Carbon Emitted:** [More Information Needed]
161
-
162
- ## Technical Specifications [optional]
163
-
164
- ### Model Architecture and Objective
165
-
166
- [More Information Needed]
167
-
168
- ### Compute Infrastructure
169
-
170
- [More Information Needed]
171
-
172
- #### Hardware
173
-
174
- [More Information Needed]
175
-
176
- #### Software
177
-
178
- [More Information Needed]
179
-
180
- ## Citation [optional]
181
-
182
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
183
-
184
- **BibTeX:**
185
-
186
- [More Information Needed]
187
-
188
- **APA:**
189
-
190
- [More Information Needed]
191
-
192
- ## Glossary [optional]
193
-
194
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
195
-
196
- [More Information Needed]
197
-
198
- ## More Information [optional]
199
-
200
- [More Information Needed]
201
-
202
- ## Model Card Authors [optional]
203
-
204
- [More Information Needed]
205
-
206
- ## Model Card Contact
207
 
208
- [More Information Needed]
 
9
 
10
 
11
 
 
 
12
  ### Model Description
13
 
14
  <!-- Provide a longer summary of what this model is. -->
 
20
  - **Model type:** Fine-tune-DeepSeek-R1-Distill-Llama-8B
21
  - **License:** MIT License
22
 
 
 
 
 
 
 
23
 
24
  ## Uses
25
 
 
40
  - **Developers & data scientists** fine-tuning and deploying the model.
41
  ### Direct Use
42
 
 
 
 
 
 
43
 
44
+ ## How to Get Started with the Model
 
 
45
 
 
46
 
47
+ import torch
48
+ from unsloth import FastLanguageModel
49
+ from transformers import AutoTokenizer
50
 
51
+ # Load model and tokenizer
52
+ model_path = "moo100/DeepSeek-R1-telecom-chatbot"
53
+ model, tokenizer = FastLanguageModel.from_pretrained(model_path, max_seq_length=1024, dtype=None)
54
 
55
+ # Optimize for fast inference
56
+ model = FastLanguageModel.for_inference(model)
57
 
58
+ # Move model to GPU if available
59
+ device = "cuda" if torch.cuda.is_available() else "cpu"
60
+ model.to(device)
61
 
62
+ # Define system instruction for guided response
63
+ system_instruction = """You are an AI assistant. Answer user questions concisely and factually.
64
+ Do NOT role-play as a customer service agent. Only answer the user's query."""
65
 
66
+ # Define user input
67
+ user_input = "What are the benefits of 5G?"
68
 
69
+ # Construct full prompt
70
+ full_prompt = f"{system_instruction}\n\nUser: {user_input}\nAssistant:"
71
 
72
+ # Tokenize input
73
+ inputs = tokenizer(full_prompt, return_tensors="pt").to(device)
74
 
75
+ # Generate response
76
+ outputs = model.generate(
77
+ input_ids=inputs.input_ids,
78
+ attention_mask=inputs.attention_mask,
79
+ max_new_tokens=100,
80
+ do_sample=True,
81
+ temperature=0.5,
82
+ top_k=50,
83
+ eos_token_id=tokenizer.eos_token_id,
84
+ )
85
 
86
+ # Decode and print response
87
+ response = tokenizer.decode(outputs[0][inputs.input_ids.shape[-1]:], skip_special_tokens=True)
88
+ print(response.strip())
89
 
 
90
 
91
  ## Training Details
92
 
 
94
 
95
  <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
96
 
97
+
98
 
99
  ### Training Procedure
100
 
101
  <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
102
 
103
+ - **Loss Curve:** Shows a steady decline, indicating model convergence.
104
+ - **Learning Rate Schedule:** Linear decay applied.
105
+ - **Gradient Norm:** Slight increase, but under control.
106
+ - **Global Steps & Epochs:** Indicates training progress.
107
 
108
+ Below are the training metrics recorded during fine-tuning:
109
+ https://drive.google.com/file/d/1-SOfG8K3Qt2WSEuyj3kFhGYOYMB5Gk2r/view?usp=sharing
110
+
 
 
 
 
 
 
 
 
 
111
 
112
  ## Evaluation
113
 
 
141
 
142
 
143
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144