Spaces:
Runtime error
Runtime error
Vision-CAIR
commited on
Commit
β’
8ce2d36
1
Parent(s):
10e8d70
Update minigpt4/conversation/conversation.py
Browse files
minigpt4/conversation/conversation.py
CHANGED
@@ -139,9 +139,8 @@ class Chat:
|
|
139 |
conv.append_message(conv.roles[1], None)
|
140 |
embs = self.get_context_emb(conv, img_list)
|
141 |
|
142 |
-
current_max_len = embs.shape[1] + max_new_tokens
|
143 |
-
|
144 |
-
begin_idx = max(0, current_max_len - max_length)
|
145 |
embs = embs[:, begin_idx:]
|
146 |
outputs = self.model.llama_model.generate(
|
147 |
inputs_embeds=embs,
|
|
|
139 |
conv.append_message(conv.roles[1], None)
|
140 |
embs = self.get_context_emb(conv, img_list)
|
141 |
|
142 |
+
current_max_len = embs.shape[1] + max_new_tokens + 100
|
143 |
+
begin_idx = max(0, current_max_len - max_length)
|
|
|
144 |
embs = embs[:, begin_idx:]
|
145 |
outputs = self.model.llama_model.generate(
|
146 |
inputs_embeds=embs,
|