yujiepan commited on
Commit
3f9bed2
1 Parent(s): e2d08cc

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -3
README.md CHANGED
@@ -10,7 +10,9 @@ library_name: transformers
10
 
11
  # yujiepan/opt-tiny-2layers-random
12
 
13
- This model is **randomly initialized**, using the config from [https://huggingface.co/facebook/opt-30b], but with following changes:
 
 
14
  ```python
15
  config.ffn_dim = 32
16
  config.hidden_size = 8
@@ -36,14 +38,13 @@ config.num_attention_heads = 2
36
  config.num_hidden_layers = 2
37
  config.word_embed_proj_dim = 8
38
 
39
- model = transformers.AutoModelForCausalLM.from_config(config, torch_dtype=torch.float16)
40
  model.save_pretrained(save_path)
41
 
42
  tokenizer = transformers.AutoTokenizer.from_pretrained('facebook/opt-30b')
43
  tokenizer.save_pretrained(save_path)
44
 
45
  ovmodel = OVModelForCausalLM.from_pretrained(save_path, export=True)
46
- ovmodel = ovmodel.half()
47
  ovmodel.save_pretrained(save_path)
48
 
49
  os.system(f'ls -alh {save_path}')
 
10
 
11
  # yujiepan/opt-tiny-2layers-random
12
 
13
+ This model is **randomly initialized**, using the config from [https://huggingface.co/facebook/opt-30b] but the size is smaller.
14
+ Note the model is in float32.
15
+
16
  ```python
17
  config.ffn_dim = 32
18
  config.hidden_size = 8
 
38
  config.num_hidden_layers = 2
39
  config.word_embed_proj_dim = 8
40
 
41
+ model = transformers.AutoModelForCausalLM.from_config(config, torch_dtype=torch.float32)
42
  model.save_pretrained(save_path)
43
 
44
  tokenizer = transformers.AutoTokenizer.from_pretrained('facebook/opt-30b')
45
  tokenizer.save_pretrained(save_path)
46
 
47
  ovmodel = OVModelForCausalLM.from_pretrained(save_path, export=True)
 
48
  ovmodel.save_pretrained(save_path)
49
 
50
  os.system(f'ls -alh {save_path}')