Skip to content

Commit

Permalink
Fix owlvit task detection (#1453)
Browse files Browse the repository at this point in the history
* fix owlvit task detection

* Update optimum/exporters/tasks.py
  • Loading branch information
fxmarty authored Oct 16, 2023
1 parent 6e15777 commit 185bc08
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions optimum/exporters/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1399,9 +1399,11 @@ def _infer_task_from_model_name_or_path(
inferred_task_name = "image-classification"
else:
pipeline_tag = getattr(model_info, "pipeline_tag", None)
# conversational is not a supported task per se, just an alias that may map to
# text-generaton or text2text-generation
if pipeline_tag is not None and pipeline_tag != "conversational":
# The Hub task "conversational" is not a supported task per se, just an alias that may map to
# text-generaton or text2text-generation.
# The Hub task "object-detection" is not a supported task per se, as in Transformers this may map to either
# zero-shot-object-detection or object-detection.
if pipeline_tag is not None and pipeline_tag not in ["conversational", "object-detection"]:
inferred_task_name = TasksManager.map_from_synonym(model_info.pipeline_tag)
else:
transformers_info = model_info.transformersInfo
Expand Down

0 comments on commit 185bc08

Please sign in to comment.