fromthesky commited on
Commit
366811c
·
1 Parent(s): dda3ae4

Updated readme

Browse files

Bumped transformers version to 4.56.1

Files changed (3) hide show
  1. README.md +21 -21
  2. config.json +1 -1
  3. requirements.txt +1 -1
README.md CHANGED
@@ -14,6 +14,7 @@ tags:
14
  license: apache-2.0
15
  datasets:
16
  - tiiuae/falcon-refinedweb
 
17
  ---
18
 
19
  # PLDR-LLM-v51-110M-4
@@ -38,7 +39,7 @@ This model is intended to be used for research purposes. Given text as input pro
38
 
39
  ### Via Huggingface Transformers Library
40
 
41
- PLDR-LLM has custom model support for Huggingface Transformers library. PLDR-LLM custom models support is developed on Transformers v4.55.4 release available at the time.
42
 
43
  Using `pipeline`:
44
  ```python
@@ -47,11 +48,13 @@ from transformers import pipeline
47
  pipeline = pipeline(
48
  task="text-generation",
49
  model="fromthesky/PLDR-LLM-v51-110M-4",
50
- device="cuda"
 
51
  )
52
 
53
- prompt="PLDR-LLM is a large language model architecture developed by Fromthesky Research Labs."
54
- output=pipeline(prompt, top_p=0.6, top_k=0, temperature=1, do_sample=True, max_new_tokens=100)
 
55
  print(output[0]["generated_text"])
56
  ```
57
 
@@ -65,21 +68,24 @@ model=AutoModelForCausalLM.from_pretrained(pretrained_model_name_or_path="fromth
65
  )
66
  tokenizer=AutoTokenizer.from_pretrained(pretrained_model_name_or_path="fromthesky/PLDR-LLM-v51-110M-4",
67
  add_eos_token=False,
68
- Legacy=False,
69
  trust_remote_code=True
70
  )
71
- prompt="PLDR-LLM is a large language model architecture developed by Fromthesky Research Labs."
 
 
72
  inputs = tokenizer([prompt], return_tensors="pt").to(device=device)
73
  generated_ids = model.generate(**inputs,
74
- max_new_tokens=100,
75
- top_p=0.6,
76
- top_k=0,
77
- temperature=1,
78
- do_sample=True,
79
- use_cache=True
80
- )
81
  print(tokenizer.decode(generated_ids[0], skip_special_tokens=True))
82
  ```
 
83
 
84
  #### PLDR-LLM specific configurations:
85
  - `custom_G_type`: `None` for learned G values during pretraining, `'identity'` for LLM with SDPA equivalent, `'random'` for G values from a random normal distribution, `'external'` for custom G values that can be assigned after model initialization. This setting is more important for training purposes, for inference it is set in the model config.json file.
@@ -94,14 +100,8 @@ the output of the residual metric learner (metric tensor, **A**), output (**A<su
94
  See config.json for other model configuration details.
95
 
96
  #### Notes:
97
- - Transformers v4.55.4 causes generation with quantized cache to fail at the time of this writing.
98
- To overcome this issue, install the most recent updates from transformers library:
99
- ```python
100
- git clone https://github.com/huggingface/transformers
101
- cd transformers
102
- pip install -e ".[dev]"
103
- ```
104
- We also have a fork of transformers library with PLDR-LLM model support for future development. The PLDR-LLM model files are added to the library so custom model files are not necessary.
105
  ```python
106
  git clone https://github.com/burcgokden/transformers
107
  cd transformers
 
14
  license: apache-2.0
15
  datasets:
16
  - tiiuae/falcon-refinedweb
17
+ library_name: transformers
18
  ---
19
 
20
  # PLDR-LLM-v51-110M-4
 
39
 
40
  ### Via Huggingface Transformers Library
41
 
42
+ PLDR-LLM has custom model support for Huggingface Transformers library. PLDR-LLM with custom code is evaluated on Transformers 4.56.1 available at the time.
43
 
44
  Using `pipeline`:
45
  ```python
 
48
  pipeline = pipeline(
49
  task="text-generation",
50
  model="fromthesky/PLDR-LLM-v51-110M-4",
51
+ device="cuda", # or "cpu"
52
+ trust_remote_code=True
53
  )
54
 
55
+ prompt=('One time they had a drumming contest, and I didn’t do very well: '
56
+ 'They said my drumming was "too intellectual"; theirs was much more pulsing.')
57
+ output=pipeline(prompt, top_p=0.6, top_k=0, temperature=1, do_sample=True, use_cache=True, max_new_tokens=100)
58
  print(output[0]["generated_text"])
59
  ```
60
 
 
68
  )
69
  tokenizer=AutoTokenizer.from_pretrained(pretrained_model_name_or_path="fromthesky/PLDR-LLM-v51-110M-4",
70
  add_eos_token=False,
71
+ legacy=False,
72
  trust_remote_code=True
73
  )
74
+
75
+ prompt=('One time they had a drumming contest, and I didn’t do very well: '
76
+ 'They said my drumming was "too intellectual"; theirs was much more pulsing.')
77
  inputs = tokenizer([prompt], return_tensors="pt").to(device=device)
78
  generated_ids = model.generate(**inputs,
79
+ max_new_tokens=100,
80
+ top_p=0.6,
81
+ top_k=0,
82
+ temperature=1,
83
+ do_sample=True,
84
+ use_cache=True
85
+ )
86
  print(tokenizer.decode(generated_ids[0], skip_special_tokens=True))
87
  ```
88
+ <sup>\*</sup> `prompt` string is a quote from Richard Feynman in Surely You're Joking, Mr. Feynman! Adventures of a Curious Character.
89
 
90
  #### PLDR-LLM specific configurations:
91
  - `custom_G_type`: `None` for learned G values during pretraining, `'identity'` for LLM with SDPA equivalent, `'random'` for G values from a random normal distribution, `'external'` for custom G values that can be assigned after model initialization. This setting is more important for training purposes, for inference it is set in the model config.json file.
 
100
  See config.json for other model configuration details.
101
 
102
  #### Notes:
103
+ - This implementation of PLDR-LLM custom code was evaluated on Transformers 4.56.1 and pytorch 2.6.0.
104
+ - We also have a fork of transformers library with PLDR-LLM model support for future development. The PLDR-LLM model files are added to the library so custom model files are not necessary.
 
 
 
 
 
 
105
  ```python
106
  git clone https://github.com/burcgokden/transformers
107
  cd transformers
config.json CHANGED
@@ -34,7 +34,7 @@
34
  "rope_theta": 10000.0,
35
  "tie_word_embeddings": false,
36
  "torch_dtype": "float32",
37
- "transformers_version": "4.55.4",
38
  "use_cache": true,
39
  "vocab_size": 32000
40
  }
 
34
  "rope_theta": 10000.0,
35
  "tie_word_embeddings": false,
36
  "torch_dtype": "float32",
37
+ "transformers_version": "4.56.1",
38
  "use_cache": true,
39
  "vocab_size": 32000
40
  }
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
- transformers==4.55.4
2
  pytorch==2.6.0
3
  sentencepiece==0.1.99
4
  python==3.11
 
1
+ transformers==4.56.1
2
  pytorch==2.6.0
3
  sentencepiece==0.1.99
4
  python==3.11