Training in progress, step 75000, checkpoint
Browse files- config.json +1 -1
- modeling_novomolgen.py +5 -1
config.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
"attention_bias": false,
|
| 3 |
"attention_dropout": 0.0,
|
| 4 |
"auto_map": {
|
| 5 |
-
"
|
| 6 |
},
|
| 7 |
"bos_token_id": 2,
|
| 8 |
"eos_token_id": 3,
|
|
|
|
| 2 |
"attention_bias": false,
|
| 3 |
"attention_dropout": 0.0,
|
| 4 |
"auto_map": {
|
| 5 |
+
"AutoModelForCausalLM": "modeling_novomolgen.NovoMolGen"
|
| 6 |
},
|
| 7 |
"bos_token_id": 2,
|
| 8 |
"eos_token_id": 3,
|
modeling_novomolgen.py
CHANGED
|
@@ -98,7 +98,7 @@ class NovoMolGenConfig(LlamaConfig):
|
|
| 98 |
self.fused_dropout_add_ln = fused_dropout_add_ln
|
| 99 |
self.residual_in_fp32 = residual_in_fp32
|
| 100 |
self.loss_type = loss_type
|
| 101 |
-
self.auto_map = {"
|
| 102 |
|
| 103 |
@classmethod
|
| 104 |
def from_pretrained(
|
|
@@ -328,3 +328,7 @@ class NovoMolGen(GPTLMHeadModel):
|
|
| 328 |
eos_position = eos_position[0, 0].item() # Get the index of the first occurrence
|
| 329 |
output[i, eos_position + 1:] = eos_id
|
| 330 |
return output
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
self.fused_dropout_add_ln = fused_dropout_add_ln
|
| 99 |
self.residual_in_fp32 = residual_in_fp32
|
| 100 |
self.loss_type = loss_type
|
| 101 |
+
self.auto_map = {"AutoModelForCausalLM": "modeling_novomolgen.NovoMolGen"}
|
| 102 |
|
| 103 |
@classmethod
|
| 104 |
def from_pretrained(
|
|
|
|
| 328 |
eos_position = eos_position[0, 0].item() # Get the index of the first occurrence
|
| 329 |
output[i, eos_position + 1:] = eos_id
|
| 330 |
return output
|
| 331 |
+
|
| 332 |
+
def prepare_inputs_for_generation(self, input_ids, attention_mask=None, **kwargs):
|
| 333 |
+
# HF’s GenerationMixin would normally do more, but for a basic LM this usually suffices:
|
| 334 |
+
return {"input_ids": input_ids, "attention_mask": attention_mask}
|