mqyqlx commited on
Commit
70b9026
1 Parent(s): 83ee88b

update readme

Browse files
Files changed (2) hide show
  1. README.md +9 -0
  2. generation_demo.py +1 -1
README.md CHANGED
@@ -13,6 +13,15 @@ and increases the expressive power of the model by dynamically composing attenti
13
 
14
  We recommend <strong>compiled version</strong> of DCFormer with *torch.compile* for inference acceleration. Please refer to QuickStart section for compile implementation.
15
 
 
 
 
 
 
 
 
 
 
16
  ## Quickstart
17
 
18
  ```
 
13
 
14
  We recommend <strong>compiled version</strong> of DCFormer with *torch.compile* for inference acceleration. Please refer to QuickStart section for compile implementation.
15
 
16
+ ## Env
17
+
18
+ You need to upgrade transformers to avoid [(loading problems)](https://github.com/huggingface/transformers/pull/29175).
19
+
20
+ ```
21
+ pip install transformers>=4.40.2
22
+ ```
23
+
24
+
25
  ## Quickstart
26
 
27
  ```
generation_demo.py CHANGED
@@ -7,7 +7,7 @@ os.environ['TOKENIZERS_PARALLELISM'] = 'false'
7
  tokenizer = AutoTokenizer.from_pretrained("Caiyun-AI/DCFormer-2.8B")
8
  model = AutoModelForCausalLM.from_pretrained("Caiyun-AI/DCFormer-2.8B", trust_remote_code=True)
9
 
10
- device = torch.device('cuda:1')
11
  MAX_BATCH_SIZE = 1
12
  MAX_SEQ_LENGTH = 2048
13
  NUM_TOKENS_TO_GENERATE = 100
 
7
  tokenizer = AutoTokenizer.from_pretrained("Caiyun-AI/DCFormer-2.8B")
8
  model = AutoModelForCausalLM.from_pretrained("Caiyun-AI/DCFormer-2.8B", trust_remote_code=True)
9
 
10
+ device = torch.device('cuda')
11
  MAX_BATCH_SIZE = 1
12
  MAX_SEQ_LENGTH = 2048
13
  NUM_TOKENS_TO_GENERATE = 100