YuWangX commited on
Commit
2a309b2
·
verified ·
1 Parent(s): b5c3187

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -2
README.md CHANGED
@@ -15,7 +15,6 @@ cd MemoryLLM
15
  Then simply use the following code to load the model:
16
  ```python
17
  from modeling_memoryllm import MemoryLLM
18
- from configuration_memoryllm import MemoryLLMConfig
19
  from transformers import AutoTokenizer
20
  model = MemoryLLM.from_pretrained("YuWangX/memoryllm-8b-chat")
21
  tokenizer = AutoTokenizer.from_pretrained("YuWangX/memoryllm-8b-chat")
@@ -29,7 +28,9 @@ Inject a piece of context into the model using the following script:
29
  model = model.cuda()
30
 
31
  # Self-Update with the new context
32
- ctx = "David likes eating apples."
 
 
33
  model.inject_memory(tokenizer(ctx, return_tensors='pt', add_special_tokens=False).input_ids.cuda(), update_memory=True)
34
 
35
  # Generation
 
15
  Then simply use the following code to load the model:
16
  ```python
17
  from modeling_memoryllm import MemoryLLM
 
18
  from transformers import AutoTokenizer
19
  model = MemoryLLM.from_pretrained("YuWangX/memoryllm-8b-chat")
20
  tokenizer = AutoTokenizer.from_pretrained("YuWangX/memoryllm-8b-chat")
 
28
  model = model.cuda()
29
 
30
  # Self-Update with the new context
31
+ ctx = "Last week, John had a wonderful picnic with David. During their conversation, David mentioned multiple times that he likes eating apples. Though he didn't mention any other fruits, John says he can infer that David also like bananas."
32
+
33
+ # please make sure the context to inject into the memory is larger than 16 tokens, this is the hard minimum when training the model. The memory will be disturbed when less than 16 tokens are injected into the memory.
34
  model.inject_memory(tokenizer(ctx, return_tensors='pt', add_special_tokens=False).input_ids.cuda(), update_memory=True)
35
 
36
  # Generation