kunjcr2 commited on
Commit
d7fafc8
·
verified ·
1 Parent(s): e1f96e6

Upload 10 files

Browse files
adapter_model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0f69b09542a6672e7d1b466def7ade25f5be3d619c0d9119b4b0c89ccf707e35
3
- size 3558888
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:73c83fcec63a448c775bfe15252caa4c8c93ce997ee107bb3897e9bdd650fec3
3
+ size 1389456
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
3
+ from peft import PeftModel, LoraConfig
4
+ import gradio as gr
5
+
6
+ # Load base model
7
+ base_model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-base")
8
+ tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-base")
9
+
10
+ # Load LoRA adapter (from local folder containing safetensor + json)
11
+ adapter_path = "/content/"
12
+ model = PeftModel.from_pretrained(base_model, adapter_path)
13
+ model.eval()
14
+
15
+ # Gradio interface
16
+ def generate(prompt):
17
+ inputs = tokenizer(prompt, return_tensors="pt")
18
+ outputs = model.generate(**inputs, max_new_tokens=100)
19
+ return tokenizer.decode(outputs[0], skip_special_tokens=True)
20
+
21
+ gr.Interface(fn=generate, inputs="text", outputs="text", title="FLAN-T5 StackOverflow Assistant").launch()
events.out.tfevents.1754682715.d9342d05aac2.3374.3 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f1b9c94ee60d588e2b489d1ebc65fc4d0a4903961cd7d6887fe02195047af21
3
+ size 7646
flan2_architecture.jpg ADDED
optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f81cc25b94b55bf811c5e168856e878f3844e598bc82e92e14e0e200212e0010
3
+ size 2833402
rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9f3d877395a79fb2e76ddf3aed2267c58e0143309e34b21fdad618a8448934b
3
+ size 14244
scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a4120a9b57085876b0b849321be75f59a03135f5c9b6c7705fc3459e2b52cf36
3
+ size 1064
special_tokens_map.json ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<extra_id_0>",
4
+ "<extra_id_1>",
5
+ "<extra_id_2>",
6
+ "<extra_id_3>",
7
+ "<extra_id_4>",
8
+ "<extra_id_5>",
9
+ "<extra_id_6>",
10
+ "<extra_id_7>",
11
+ "<extra_id_8>",
12
+ "<extra_id_9>",
13
+ "<extra_id_10>",
14
+ "<extra_id_11>",
15
+ "<extra_id_12>",
16
+ "<extra_id_13>",
17
+ "<extra_id_14>",
18
+ "<extra_id_15>",
19
+ "<extra_id_16>",
20
+ "<extra_id_17>",
21
+ "<extra_id_18>",
22
+ "<extra_id_19>",
23
+ "<extra_id_20>",
24
+ "<extra_id_21>",
25
+ "<extra_id_22>",
26
+ "<extra_id_23>",
27
+ "<extra_id_24>",
28
+ "<extra_id_25>",
29
+ "<extra_id_26>",
30
+ "<extra_id_27>",
31
+ "<extra_id_28>",
32
+ "<extra_id_29>",
33
+ "<extra_id_30>",
34
+ "<extra_id_31>",
35
+ "<extra_id_32>",
36
+ "<extra_id_33>",
37
+ "<extra_id_34>",
38
+ "<extra_id_35>",
39
+ "<extra_id_36>",
40
+ "<extra_id_37>",
41
+ "<extra_id_38>",
42
+ "<extra_id_39>",
43
+ "<extra_id_40>",
44
+ "<extra_id_41>",
45
+ "<extra_id_42>",
46
+ "<extra_id_43>",
47
+ "<extra_id_44>",
48
+ "<extra_id_45>",
49
+ "<extra_id_46>",
50
+ "<extra_id_47>",
51
+ "<extra_id_48>",
52
+ "<extra_id_49>",
53
+ "<extra_id_50>",
54
+ "<extra_id_51>",
55
+ "<extra_id_52>",
56
+ "<extra_id_53>",
57
+ "<extra_id_54>",
58
+ "<extra_id_55>",
59
+ "<extra_id_56>",
60
+ "<extra_id_57>",
61
+ "<extra_id_58>",
62
+ "<extra_id_59>",
63
+ "<extra_id_60>",
64
+ "<extra_id_61>",
65
+ "<extra_id_62>",
66
+ "<extra_id_63>",
67
+ "<extra_id_64>",
68
+ "<extra_id_65>",
69
+ "<extra_id_66>",
70
+ "<extra_id_67>",
71
+ "<extra_id_68>",
72
+ "<extra_id_69>",
73
+ "<extra_id_70>",
74
+ "<extra_id_71>",
75
+ "<extra_id_72>",
76
+ "<extra_id_73>",
77
+ "<extra_id_74>",
78
+ "<extra_id_75>",
79
+ "<extra_id_76>",
80
+ "<extra_id_77>",
81
+ "<extra_id_78>",
82
+ "<extra_id_79>",
83
+ "<extra_id_80>",
84
+ "<extra_id_81>",
85
+ "<extra_id_82>",
86
+ "<extra_id_83>",
87
+ "<extra_id_84>",
88
+ "<extra_id_85>",
89
+ "<extra_id_86>",
90
+ "<extra_id_87>",
91
+ "<extra_id_88>",
92
+ "<extra_id_89>",
93
+ "<extra_id_90>",
94
+ "<extra_id_91>",
95
+ "<extra_id_92>",
96
+ "<extra_id_93>",
97
+ "<extra_id_94>",
98
+ "<extra_id_95>",
99
+ "<extra_id_96>",
100
+ "<extra_id_97>",
101
+ "<extra_id_98>",
102
+ "<extra_id_99>"
103
+ ],
104
+ "eos_token": {
105
+ "content": "</s>",
106
+ "lstrip": false,
107
+ "normalized": false,
108
+ "rstrip": false,
109
+ "single_word": false
110
+ },
111
+ "pad_token": {
112
+ "content": "<pad>",
113
+ "lstrip": false,
114
+ "normalized": false,
115
+ "rstrip": false,
116
+ "single_word": false
117
+ },
118
+ "unk_token": {
119
+ "content": "<unk>",
120
+ "lstrip": false,
121
+ "normalized": false,
122
+ "rstrip": false,
123
+ "single_word": false
124
+ }
125
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
trainer_state.json ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_global_step": 500,
3
+ "best_metric": 2.775390625,
4
+ "best_model_checkpoint": "./stackoverflow_flan_finetune/checkpoint-500",
5
+ "epoch": 0.14819205690574985,
6
+ "eval_steps": 100,
7
+ "global_step": 500,
8
+ "is_hyper_param_search": false,
9
+ "is_local_process_zero": true,
10
+ "is_world_process_zero": true,
11
+ "log_history": [
12
+ {
13
+ "epoch": 0.02963841138114997,
14
+ "grad_norm": 0.5776488780975342,
15
+ "learning_rate": 0.0004853289863663308,
16
+ "loss": 9.4912,
17
+ "step": 100
18
+ },
19
+ {
20
+ "epoch": 0.02963841138114997,
21
+ "eval_loss": 3.810546875,
22
+ "eval_runtime": 26.2211,
23
+ "eval_samples_per_second": 57.168,
24
+ "eval_steps_per_second": 7.17,
25
+ "step": 100
26
+ },
27
+ {
28
+ "epoch": 0.05927682276229994,
29
+ "grad_norm": 0.5113403797149658,
30
+ "learning_rate": 0.0004705097806757558,
31
+ "loss": 3.9372,
32
+ "step": 200
33
+ },
34
+ {
35
+ "epoch": 0.05927682276229994,
36
+ "eval_loss": 3.38671875,
37
+ "eval_runtime": 26.0016,
38
+ "eval_samples_per_second": 57.65,
39
+ "eval_steps_per_second": 7.23,
40
+ "step": 200
41
+ },
42
+ {
43
+ "epoch": 0.08891523414344991,
44
+ "grad_norm": 1.3626296520233154,
45
+ "learning_rate": 0.0004556905749851808,
46
+ "loss": 3.5486,
47
+ "step": 300
48
+ },
49
+ {
50
+ "epoch": 0.08891523414344991,
51
+ "eval_loss": 3.048828125,
52
+ "eval_runtime": 27.2076,
53
+ "eval_samples_per_second": 55.095,
54
+ "eval_steps_per_second": 6.91,
55
+ "step": 300
56
+ },
57
+ {
58
+ "epoch": 0.11855364552459988,
59
+ "grad_norm": 0.4870101511478424,
60
+ "learning_rate": 0.0004408713692946058,
61
+ "loss": 3.2785,
62
+ "step": 400
63
+ },
64
+ {
65
+ "epoch": 0.11855364552459988,
66
+ "eval_loss": 2.828125,
67
+ "eval_runtime": 26.0791,
68
+ "eval_samples_per_second": 57.479,
69
+ "eval_steps_per_second": 7.209,
70
+ "step": 400
71
+ },
72
+ {
73
+ "epoch": 0.14819205690574985,
74
+ "grad_norm": 1.628702163696289,
75
+ "learning_rate": 0.00042605216360403083,
76
+ "loss": 3.1755,
77
+ "step": 500
78
+ },
79
+ {
80
+ "epoch": 0.14819205690574985,
81
+ "eval_loss": 2.775390625,
82
+ "eval_runtime": 26.1328,
83
+ "eval_samples_per_second": 57.361,
84
+ "eval_steps_per_second": 7.194,
85
+ "step": 500
86
+ }
87
+ ],
88
+ "logging_steps": 100,
89
+ "max_steps": 3374,
90
+ "num_input_tokens_seen": 0,
91
+ "num_train_epochs": 1,
92
+ "save_steps": 500,
93
+ "stateful_callbacks": {
94
+ "EarlyStoppingCallback": {
95
+ "args": {
96
+ "early_stopping_patience": 1,
97
+ "early_stopping_threshold": 0.0
98
+ },
99
+ "attributes": {
100
+ "early_stopping_patience_counter": 0
101
+ }
102
+ },
103
+ "TrainerControl": {
104
+ "args": {
105
+ "should_epoch_stop": false,
106
+ "should_evaluate": false,
107
+ "should_log": false,
108
+ "should_save": true,
109
+ "should_training_stop": false
110
+ },
111
+ "attributes": {}
112
+ }
113
+ },
114
+ "total_flos": 373894938624000.0,
115
+ "train_batch_size": 4,
116
+ "trial_name": null,
117
+ "trial_params": null
118
+ }