Skip to content

Commit

Permalink
update models
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishu26 committed May 29, 2024
1 parent 676eb85 commit 5f6553b
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 2 deletions.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ timm==1.0.3
numpy==1.26.4
huggingface_hub==0.23.1
einops==0.8.0
transformers==4.41.1
transformers==4.41.1
open_clip_torch==2.24.0
1 change: 1 addition & 0 deletions rshf/bioclip/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .model import BioCLIP
9 changes: 9 additions & 0 deletions rshf/bioclip/model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import open_clip
import torch.nn as nn
from huggingface_hub import PyTorchModelHubMixin

class BioCLIP(nn.Module, PyTorchModelHubMixin):
def __init__(self, model_name="hf-hub:imageomics/bioclip"):
super().__init__()
self.model, _, self.preprocess = open_clip.create_model_and_transforms(model_name)
self.tokenizer = open_clip.get_tokenizer(model_name)
1 change: 1 addition & 0 deletions rshf/clip/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from transformers import CLIPProcessor, CLIPModel, CLIPTextModel, CLIPVisionModel
1 change: 1 addition & 0 deletions rshf/remoteclip/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .model import RemoteCLIP
9 changes: 9 additions & 0 deletions rshf/remoteclip/model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import open_clip
import torch.nn as nn
from huggingface_hub import PyTorchModelHubMixin

class RemoteCLIP(nn.Module, PyTorchModelHubMixin):
def __init__(self, model_name="ViT-B-32"):
super().__init__()
self.model, _, self.preprocess = open_clip.create_model_and_transforms(model_name)
self.tokenizer = open_clip.get_tokenizer(model_name)
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = rshf
version = 0.0.4
version = 0.0.5
author = Srikumar Sastry
author_email = [email protected]
description = RS pretrained models in huggingface style
Expand Down

0 comments on commit 5f6553b

Please sign in to comment.