Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ model = BlenderbotForConditionalGeneration.from_pretrained(mname)
|
|
60 |
tokenizer = BlenderbotTokenizer.from_pretrained(mname)
|
61 |
|
62 |
def take_last_tokens(inputs, note_history, history):
|
63 |
-
|
64 |
if inputs['input_ids'].shape[1] > filterTokenCount:
|
65 |
inputs['input_ids'] = torch.tensor([inputs['input_ids'][0][-filterTokenCount:].tolist()])
|
66 |
inputs['attention_mask'] = torch.tensor([inputs['attention_mask'][0][-filterTokenCount:].tolist()])
|
|
|
60 |
tokenizer = BlenderbotTokenizer.from_pretrained(mname)
|
61 |
|
62 |
def take_last_tokens(inputs, note_history, history):
|
63 |
+
filterTokenCount = 128 # filter last 128 tokens
|
64 |
if inputs['input_ids'].shape[1] > filterTokenCount:
|
65 |
inputs['input_ids'] = torch.tensor([inputs['input_ids'][0][-filterTokenCount:].tolist()])
|
66 |
inputs['attention_mask'] = torch.tensor([inputs['attention_mask'][0][-filterTokenCount:].tolist()])
|