Skip to content

Commit

Permalink
clean up copy paste
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-chung committed Oct 18, 2023
1 parent 57dc032 commit 561be59
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions optimum/exporters/onnx/model_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,17 +753,7 @@ def outputs(self) -> Dict[str, Dict[int, str]]:

class OpenCLIPOnnxConfig(CLIPOnnxConfig):

@property
def outputs(self) -> Dict[str, Dict[int, str]]:
return {
"logits_per_image": {0: "image_batch_size", 1: "text_batch_size"},
"logits_per_text": {0: "text_batch_size", 1: "image_batch_size"},
"text_embeds": {0: "text_batch_size"},
"image_embeds": {0: "image_batch_size"},
}

def rename_ambiguous_inputs(self, inputs):
# The input name in the model signature is `x, hence the export input name is updated.
model_inputs = {}
model_inputs["image"] = inputs["pixel_values"]
model_inputs["text"] = inputs["input_ids"]
Expand Down
2 changes: 1 addition & 1 deletion tests/exporters/exporters_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,4 @@

PYTORCH_OPEN_CLIP_MODEL = {
"open-clip": "laion/CLIP-ViT-B-16-laion2B-s34B-b88K",
}
}

0 comments on commit 561be59

Please sign in to comment.