Skip to content

Commit

Permalink
Update glmv_helper.py (#2623)
Browse files Browse the repository at this point in the history
  • Loading branch information
openvino-dev-samples authored Jan 6, 2025
1 parent 9f9376a commit 5709bb5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions notebooks/glm-edge-v/glmv_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,7 @@ def convert_glmv_model(model_id, output_dir, quantization_config):
input_ids = torch.zeros([2, 2], dtype=torch.int64)
inputs_embeds = torch.zeros([2, 2, config.hidden_size], dtype=torch.float32)

pkv = model.model(
input_ids=input_ids,
attention_mask=torch.ones((2, 2), dtype=torch.int64),
)[1]
pkv = model.model(input_ids=input_ids, attention_mask=torch.ones((2, 2), dtype=torch.int64), images=torch.zeros([1, 3, image_size, image_size]))[1]
model.forward = types.MethodType(_glmv_transformer_forward, model)

model.config.torchscript = True
Expand Down

0 comments on commit 5709bb5

Please sign in to comment.