Skip to content

Commit

Permalink
chore: update HF model naming convention (#72)
Browse files Browse the repository at this point in the history
Make model naming conventions consistent with the dataset naming conventions.
  • Loading branch information
eloy-encord committed May 7, 2024
1 parent df4a8ef commit 219f89f
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ Below is an example of a model definition for the [clip](https://huggingface.co/

```json
{
"model_type": "ClosedCLIPModel",
"model_type": "HFModel",
"title": "clip",
"title_in_source": "openai/clip-vit-large-patch14-336"
}
Expand Down Expand Up @@ -331,9 +331,9 @@ Here is an example of how to register a model from Hugging Face using Python cod

```python
from tti_eval.model import ModelProvider
from tti_eval.model.types import ClosedCLIPModel
from tti_eval.model.types import HFModel

ModelProvider.register_model(ClosedCLIPModel, "clip", title_in_source="openai/clip-vit-large-patch14-336")
ModelProvider.register_model(HFModel, "clip", title_in_source="openai/clip-vit-large-patch14-336")
model = ModelProvider.get_model("clip")
print(model.title, model.title_in_source) # Returns: clip openai/clip-vit-large-patch14-336
```
Expand Down
2 changes: 1 addition & 1 deletion sources/models/clip.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"model_type": "ClosedCLIPModel",
"model_type": "HFModel",
"title": "clip",
"title_in_source": "openai/clip-vit-large-patch14-336"
}
2 changes: 1 addition & 1 deletion sources/models/fashion.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"model_type": "ClosedCLIPModel",
"model_type": "HFModel",
"title": "fashion",
"title_in_source": "patrickjohncyh/fashion-clip"
}
2 changes: 1 addition & 1 deletion sources/models/plip.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"model_type": "ClosedCLIPModel",
"model_type": "HFModel",
"title": "plip",
"title_in_source": "vinid/plip"
}
2 changes: 1 addition & 1 deletion sources/models/pubmed.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"model_type": "ClosedCLIPModel",
"model_type": "HFModel",
"title": "pubmed",
"title_in_source": "flaviagiammarino/pubmed-clip-vit-base-patch32"
}
2 changes: 1 addition & 1 deletion sources/models/rsicd.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"model_type": "ClosedCLIPModel",
"model_type": "HFModel",
"title": "rsicd",
"title_in_source": "flax-community/clip-rsicd"
}
2 changes: 1 addition & 1 deletion sources/models/siglip_large.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"model_type": "ClosedCLIPModel",
"model_type": "HFModel",
"title": "siglip_large",
"title_in_source": "google/siglip-large-patch16-256"
}
2 changes: 1 addition & 1 deletion sources/models/siglip_small.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"model_type": "ClosedCLIPModel",
"model_type": "HFModel",
"title": "siglip_small",
"title_in_source": "google/siglip-base-patch16-224"
}
2 changes: 1 addition & 1 deletion sources/models/street.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"model_type": "ClosedCLIPModel",
"model_type": "HFModel",
"title": "street",
"title_in_source": "geolocal/StreetCLIP"
}
2 changes: 1 addition & 1 deletion sources/models/tinyclip.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"model_type": "ClosedCLIPModel",
"model_type": "HFModel",
"title": "tinyclip",
"title_in_source": "wkcn/TinyCLIP-ViT-40M-32-Text-19M-LAION400M"
}
2 changes: 1 addition & 1 deletion tti_eval/model/types/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from tti_eval.model.types.hugging_face_clip import ClosedCLIPModel
from tti_eval.model.types.hugging_face import HFModel
from tti_eval.model.types.local_clip_model import LocalCLIPModel
from tti_eval.model.types.open_clip_model import OpenCLIPModel
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from tti_eval.model import Model


class ClosedCLIPModel(Model):
class HFModel(Model):
def __init__(
self,
title: str,
Expand Down

0 comments on commit 219f89f

Please sign in to comment.