ericsorides
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -79,7 +79,7 @@ def generate_text(model_path, prompt, tokenizer, max_gen_tokens, total_sequence,
|
|
79 |
inputs_dict = {}
|
80 |
inputs_dict['input_ids'] = actual_input[:, :window].reshape(1, window).numpy()
|
81 |
inputs_dict['attention_mask'] = first_attention
|
82 |
-
inputs_dict['tree_attention'] = np.triu(-65504*np.ones(
|
83 |
for name in inputs_names:
|
84 |
if name == 'input_ids' or name == 'attention_mask' or name == 'tree_attention': continue
|
85 |
inputs_dict[name] = np.zeros([1, n_heads, context-window, 128], dtype="float16")
|
|
|
79 |
inputs_dict = {}
|
80 |
inputs_dict['input_ids'] = actual_input[:, :window].reshape(1, window).numpy()
|
81 |
inputs_dict['attention_mask'] = first_attention
|
82 |
+
inputs_dict['tree_attention'] = np.triu(-65504*np.ones(total_sequence), k= 1).astype('float16').reshape(1, 1, total_sequence, total_sequence)
|
83 |
for name in inputs_names:
|
84 |
if name == 'input_ids' or name == 'attention_mask' or name == 'tree_attention': continue
|
85 |
inputs_dict[name] = np.zeros([1, n_heads, context-window, 128], dtype="float16")
|