Upload mmalaya_arch.py
Browse files- mmalaya_arch.py +5 -1
mmalaya_arch.py
CHANGED
|
@@ -300,7 +300,11 @@ class MMAlayaMetaForCausalLM(ABC):
|
|
| 300 |
input_ids.extend(x[offset:])
|
| 301 |
|
| 302 |
# 加载generate stop条件
|
| 303 |
-
stopping_criteria = KeywordsStoppingCriteria(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 304 |
# 加载图像
|
| 305 |
image_processor = model.get_vision_tower().image_processor
|
| 306 |
image_tensor = image_processor(image, return_tensors='pt')['pixel_values'].half().cuda()
|
|
|
|
| 300 |
input_ids.extend(x[offset:])
|
| 301 |
|
| 302 |
# 加载generate stop条件
|
| 303 |
+
stopping_criteria = KeywordsStoppingCriteria(
|
| 304 |
+
[conv.sep2],
|
| 305 |
+
tokenizer,
|
| 306 |
+
torch.tensor(input_ids, dtype=torch.long),
|
| 307 |
+
)
|
| 308 |
# 加载图像
|
| 309 |
image_processor = model.get_vision_tower().image_processor
|
| 310 |
image_tensor = image_processor(image, return_tensors='pt')['pixel_values'].half().cuda()
|