End of training
Browse files
README.md
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
base_model: vikhyatk/moondream2
|
4 |
+
tags:
|
5 |
+
- generated_from_trainer
|
6 |
+
model-index:
|
7 |
+
- name: training_the_moon
|
8 |
+
results: []
|
9 |
+
---
|
10 |
+
|
11 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
12 |
+
should probably proofread and complete it, then remove this comment. -->
|
13 |
+
|
14 |
+
# training_the_moon
|
15 |
+
|
16 |
+
This model is a fine-tuned version of [vikhyatk/moondream2](https://huggingface.co/vikhyatk/moondream2) on an unknown dataset.
|
17 |
+
|
18 |
+
## Model description
|
19 |
+
|
20 |
+
More information needed
|
21 |
+
|
22 |
+
## Intended uses & limitations
|
23 |
+
|
24 |
+
More information needed
|
25 |
+
|
26 |
+
## Training and evaluation data
|
27 |
+
|
28 |
+
More information needed
|
29 |
+
|
30 |
+
## Training procedure
|
31 |
+
|
32 |
+
### Training hyperparameters
|
33 |
+
|
34 |
+
The following hyperparameters were used during training:
|
35 |
+
- learning_rate: 2e-05
|
36 |
+
- train_batch_size: 4
|
37 |
+
- eval_batch_size: 8
|
38 |
+
- seed: 42
|
39 |
+
- gradient_accumulation_steps: 4
|
40 |
+
- total_train_batch_size: 16
|
41 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
42 |
+
- lr_scheduler_type: linear
|
43 |
+
- lr_scheduler_warmup_steps: 2
|
44 |
+
- num_epochs: 2
|
45 |
+
|
46 |
+
### Training results
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
+
### Framework versions
|
51 |
+
|
52 |
+
- Transformers 4.41.2
|
53 |
+
- Pytorch 2.3.1+cu121
|
54 |
+
- Datasets 2.19.2
|
55 |
+
- Tokenizers 0.19.1
|
configuration_moondream.py
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import PretrainedConfig
|
2 |
+
|
3 |
+
|
4 |
+
class PhiConfig(PretrainedConfig):
|
5 |
+
model_type = "phi"
|
6 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
7 |
+
|
8 |
+
def __init__(
|
9 |
+
self,
|
10 |
+
vocab_size=51200,
|
11 |
+
hidden_size=2048,
|
12 |
+
intermediate_size=8192,
|
13 |
+
num_hidden_layers=24,
|
14 |
+
num_attention_heads=32,
|
15 |
+
num_key_value_heads=None,
|
16 |
+
resid_pdrop=0.0,
|
17 |
+
embd_pdrop=0.0,
|
18 |
+
attention_dropout=0.0,
|
19 |
+
hidden_act="gelu_new",
|
20 |
+
max_position_embeddings=2048,
|
21 |
+
initializer_range=0.02,
|
22 |
+
layer_norm_eps=1e-5,
|
23 |
+
use_cache=True,
|
24 |
+
tie_word_embeddings=False,
|
25 |
+
rope_theta=10000.0,
|
26 |
+
rope_scaling=None,
|
27 |
+
partial_rotary_factor=0.5,
|
28 |
+
qk_layernorm=False,
|
29 |
+
bos_token_id=1,
|
30 |
+
eos_token_id=2,
|
31 |
+
**kwargs,
|
32 |
+
):
|
33 |
+
self.vocab_size = vocab_size
|
34 |
+
self.hidden_size = hidden_size
|
35 |
+
self.intermediate_size = intermediate_size
|
36 |
+
self.num_hidden_layers = num_hidden_layers
|
37 |
+
self.num_attention_heads = num_attention_heads
|
38 |
+
|
39 |
+
if num_key_value_heads is None:
|
40 |
+
num_key_value_heads = num_attention_heads
|
41 |
+
|
42 |
+
self.num_key_value_heads = num_key_value_heads
|
43 |
+
self.resid_pdrop = resid_pdrop
|
44 |
+
self.embd_pdrop = embd_pdrop
|
45 |
+
self.attention_dropout = attention_dropout
|
46 |
+
self.hidden_act = hidden_act
|
47 |
+
self.max_position_embeddings = max_position_embeddings
|
48 |
+
self.initializer_range = initializer_range
|
49 |
+
self.layer_norm_eps = layer_norm_eps
|
50 |
+
self.use_cache = use_cache
|
51 |
+
self.rope_theta = rope_theta
|
52 |
+
self.rope_scaling = rope_scaling
|
53 |
+
self.partial_rotary_factor = partial_rotary_factor
|
54 |
+
self.qk_layernorm = qk_layernorm
|
55 |
+
self._rope_scaling_validation()
|
56 |
+
|
57 |
+
super().__init__(
|
58 |
+
bos_token_id=bos_token_id,
|
59 |
+
eos_token_id=eos_token_id,
|
60 |
+
tie_word_embeddings=tie_word_embeddings,
|
61 |
+
**kwargs,
|
62 |
+
)
|
63 |
+
|
64 |
+
# Copied from transformers.models.llama.configuration_llama.LlamaConfig._rope_scaling_validation
|
65 |
+
def _rope_scaling_validation(self):
|
66 |
+
"""
|
67 |
+
Validate the `rope_scaling` configuration.
|
68 |
+
"""
|
69 |
+
if self.rope_scaling is None:
|
70 |
+
return
|
71 |
+
|
72 |
+
if not isinstance(self.rope_scaling, dict) or len(self.rope_scaling) != 2:
|
73 |
+
raise ValueError(
|
74 |
+
"`rope_scaling` must be a dictionary with with two fields, `type` and `factor`, "
|
75 |
+
f"got {self.rope_scaling}"
|
76 |
+
)
|
77 |
+
rope_scaling_type = self.rope_scaling.get("type", None)
|
78 |
+
rope_scaling_factor = self.rope_scaling.get("factor", None)
|
79 |
+
if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic"]:
|
80 |
+
raise ValueError(
|
81 |
+
f"`rope_scaling`'s type field must be one of ['linear', 'dynamic'], got {rope_scaling_type}"
|
82 |
+
)
|
83 |
+
if (
|
84 |
+
rope_scaling_factor is None
|
85 |
+
or not isinstance(rope_scaling_factor, float)
|
86 |
+
or rope_scaling_factor <= 1.0
|
87 |
+
):
|
88 |
+
raise ValueError(
|
89 |
+
f"`rope_scaling`'s factor field must be a float > 1, got {rope_scaling_factor}"
|
90 |
+
)
|
91 |
+
|
92 |
+
|
93 |
+
class MoondreamConfig(PretrainedConfig):
|
94 |
+
model_type = "moondream1"
|
95 |
+
|
96 |
+
def __init__(self, **kwargs):
|
97 |
+
self.text_config = PhiConfig(**kwargs.pop("text_config", {}))
|
98 |
+
super().__init__(**kwargs)
|
generation_config.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 1,
|
4 |
+
"eos_token_id": 2,
|
5 |
+
"transformers_version": "4.41.2"
|
6 |
+
}
|
runs/Jun05_22-09-36_158-101-18-255/events.out.tfevents.1717625377.158-101-18-255.10761.0
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1124aedbbc8934ef4ac30dfe9c40a136995f956f634bb5a84845238574bba2f1
|
3 |
+
size 5528
|