harpomaxx commited on
Commit
0240a54
1 Parent(s): 17e8890

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +83 -0
README.md ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: openrail
3
+ datasets:
4
+ - lucasmccabe-lmi/CodeAlpaca-20k
5
+ language:
6
+ - en
7
+ library_name: adapter-transformers
8
+ ---
9
+
10
+ # Model Card for `opt350m-codealpaca20k`
11
+
12
+ ## Model Description
13
+
14
+ A simple opt350m model trained on the CodeAlpaca dataset using quantization and Progressive Embedding Fine-Tuning (PEFT). It's designed to understand and generate code-related responses based on the prompts provided.
15
+
16
+ ### Model Architecture
17
+
18
+ - **Base Model**: `facebook/opt-350m`
19
+ - **Fine-tuning**: Progressive Embedding Fine-Tuning (PEFT)
20
+
21
+ ## Training Data
22
+
23
+ The model was trained on the `lucasmccabe-lmi/CodeAlpaca-20k` dataset. This dataset contains code-related prompts and their corresponding outputs.
24
+
25
+ ## Training Procedure
26
+
27
+ ### Quantization Configuration:
28
+
29
+ - **Quantization Type**: 4-bit
30
+ - **Compute Dtype**: float16
31
+ - **Double Quant**: Enabled
32
+
33
+ ### PEFT Configuration:
34
+
35
+ - **Lora Alpha**: 16
36
+ - **Lora Dropout**: 0.5
37
+ - **Bias**: None
38
+ - **Task Type**: CAUSAL_LM
39
+ - **Target Modules**: q_proj, v_proj, k_proj
40
+
41
+ ### Training Arguments:
42
+
43
+ - **Output Directory**: `./results`
44
+ - **Batch Size**: 4 (per device)
45
+ - **Gradient Accumulation Steps**: 2
46
+ - **Number of Epochs**: 10
47
+ - **Optimizer**: `adamw_bnb_8bit`
48
+ - **Learning Rate**: 2e-5
49
+ - **Max Gradient Norm**: 0.3
50
+ - **Warmup Ratio**: 0.03
51
+ - **Learning Rate Scheduler**: Cosine
52
+ - **Logging Steps**: 10
53
+ - **Save Steps**: 250
54
+ - **FP16 Precision**: Enabled
55
+
56
+ ## Usage
57
+
58
+ ```python
59
+ from transformers import AutoModelForCausalLM, AutoTokenizer
60
+
61
+ tokenizer = AutoTokenizer.from_pretrained("facebook/opt350m")
62
+ model = AutoModelForCausalLM.from_pretrained("harpomaxx/opt350m-codealpaca20k)
63
+
64
+ prompt = "### Question: [Your code-related question here]"
65
+ inputs = tokenizer.encode(prompt, return_tensors="pt")
66
+ outputs = model.generate(inputs)
67
+ decoded_output = tokenizer.decode(outputs[0], skip_special_tokens=True)
68
+
69
+ print(decoded_output)
70
+ ```
71
+
72
+ ## Limitations and Bias
73
+
74
+ - The model is specifically fine-tuned for code-related tasks, and its performance on other tasks might not be optimal.
75
+ - The biases in the CodeAlpaca dataset might be reflected in the model's outputs.
76
+
77
+ ## License
78
+
79
+ [Specify the license under which the model is released.]
80
+
81
+ ---
82
+
83
+ Remember to replace placeholders like `your_model_name_here` with the actual name or path of your model. Adjust any other details as necessary to fit the specifics of your model and its training.