PursuitOfDataScience commited on
Commit
448330c
·
verified ·
1 Parent(s): 751d80b

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +75 -0
README.md ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ datasets:
4
+ - tuanha1305/DeepSeek-R1-Distill
5
+ language:
6
+ - en
7
+ base_model:
8
+ - Qwen/Qwen2.5-1.5B-Instruct
9
+ ---
10
+
11
+ # Qwen2.5-1.5B-Instruct-Lora-Deepseek-R1
12
+
13
+ This model is a LoRA (Low-Rank Adaptation) fine-tuned version of **Qwen2.5-1.5B-Instruct**, specifically fine-tuned on the **DeepSeek-R1-Distill** dataset. LoRA was applied to the query (`q`), key (`k`), and value (`v`) projection matrices.
14
+
15
+ **Base Model:** [Qwen2.5-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct)
16
+ **Dataset:** [tuanha1305/DeepSeek-R1-Distill](https://huggingface.co/datasets/tuanha1305/DeepSeek-R1-Distill)
17
+
18
+ ---
19
+
20
+ ## Training Details
21
+
22
+ - **Hardware:** 1 × NVIDIA A100 GPU (80GB HBM)
23
+ - **Training Time:** ~7 hours and 17 minutes
24
+ - **Total Steps:** 9000
25
+ - **Fine-tuning Method:** LoRA (q, k, v)
26
+
27
+ ---
28
+
29
+ ## How to Use
30
+
31
+ ### Example Python Script
32
+ ```python
33
+ import torch
34
+ from transformers import AutoModelForCausalLM, AutoTokenizer
35
+
36
+ model_name = "PursuitOfDataScience/Qwen2.5-1.5B-Instruct-Lora-Deepseek-R1"
37
+
38
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
39
+ model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
40
+
41
+ test_prompt = "Instruction: Explain how machine learning works\nResponse:"
42
+ inputs = tokenizer(test_prompt, return_tensors="pt").to(model.device)
43
+
44
+ with torch.no_grad():
45
+ outputs = model.generate(
46
+ inputs.input_ids,
47
+ max_length=200,
48
+ temperature=0.7,
49
+ top_p=0.95,
50
+ do_sample=True
51
+ )
52
+
53
+ generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
54
+ print(f"\nGenerated response:\n{generated_text}")
55
+
56
+ ```
57
+
58
+ ### Sample Output
59
+
60
+ ```
61
+ Instruction: Explain how machine learning works
62
+ Response: Machine learning is a subset of artificial intelligence that allows computers to learn from data without being explicitly programmed. It involves using algorithms and statistical models to analyze patterns, trends, or relationships in large sets of data and then making predictions or decisions based on these insights.
63
+
64
+ Here's an overview of the key steps involved in implementing a machine learning model:
65
+
66
+ 1. Data collection: Gather historical data relevant to your problem domain.
67
+ 2. Data preprocessing: Cleanse, normalize, and transform raw data into a format suitable for analysis.
68
+ 3. Feature selection: Identify important features (variables) that can help predict outcomes.
69
+ 4. Model training: Train various machine learning algorithms on subsets of labeled data.
70
+ 5. Model evaluation: Assess performance metrics like accuracy, precision, recall, etc., using test datasets.
71
+ 6. Model tuning: Optimize hyperparameters and tweak algorithm settings to improve predictive power.
72
+ 7. Deployment: Implement trained models in production systems for real-time predictions.
73
+
74
+ ```
75
+