Aobangaming commited on
Commit
22ddb49
·
verified ·
1 Parent(s): 72f0568

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -36
README.md CHANGED
@@ -73,45 +73,10 @@ and add necessary guardrails and precautions to prevent misuse.
73
 
74
  Use the code below to get started with the model.
75
  ```python
76
- import sys
77
- import types
78
  import torch
79
-
80
- from transformers import PretrainedConfig, AutoModelForCausalLM
81
  from tokenizers import Tokenizer
82
 
83
-
84
- class LightningConfig(PretrainedConfig):
85
- model_type = "lightning"
86
-
87
- def __init__(
88
- self,
89
- vocab_size=50000,
90
- d_model=256,
91
- nhead=4,
92
- num_layers=4,
93
- dropout=0.1,
94
- max_seq_len=160,
95
- **kwargs
96
- ):
97
- super().__init__(
98
- tie_word_embeddings=False,
99
- **kwargs
100
- )
101
-
102
- self.vocab_size = vocab_size
103
- self.d_model = d_model
104
- self.nhead = nhead
105
- self.num_layers = num_layers
106
- self.dropout = dropout
107
- self.max_seq_len = max_seq_len
108
-
109
-
110
- config_module = types.ModuleType("configuration_lightning")
111
- config_module.LightningConfig = LightningConfig
112
- sys.modules["configuration_lightning"] = config_module
113
-
114
-
115
  model_id = "Aobangaming/lightning-30m-ft"
116
 
117
  model = AutoModelForCausalLM.from_pretrained(
@@ -135,6 +100,7 @@ outputs = model.generate(
135
  )
136
 
137
  print(tokenizer.decode(outputs[0].tolist()))
 
138
  ```
139
 
140
  ## Training Details
 
73
 
74
  Use the code below to get started with the model.
75
  ```python
 
 
76
  import torch
77
+ from transformers import AutoModelForCausalLM
 
78
  from tokenizers import Tokenizer
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  model_id = "Aobangaming/lightning-30m-ft"
81
 
82
  model = AutoModelForCausalLM.from_pretrained(
 
100
  )
101
 
102
  print(tokenizer.decode(outputs[0].tolist()))
103
+
104
  ```
105
 
106
  ## Training Details