Skip to content

Commit

Permalink
Update modeling.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoisonooo authored Jul 23, 2024
1 parent b768035 commit 3f84da0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions FlagEmbedding/visual/modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,21 @@ def __init__(self,
):
super().__init__()

assert model_name_bge in ["BAAI/bge-base-en-v1.5", "BAAI/bge-m3"]
assert 'bge' in model_name_bge
assert model_weight is not None

self.model_name_bge = model_name_bge

if model_name_bge == 'BAAI/bge-base-en-v1.5':
if 'bge-base-en-v1.5' in model_name_bge:
model_name_eva = "EVA02-CLIP-B-16"
self.hidden_dim = 768
self.depth = 12
elif model_name_bge == 'BAAI/bge-m3':
elif 'bge-m3' in model_name_bge:
model_name_eva = "EVA02-CLIP-L-14"
self.hidden_dim = 1024
self.depth = 24
else:
raise Exception(f'Unavailable model_name {model_name_bge}')

if not from_pretrained:
bge_config = AutoConfig.from_pretrained(model_name_bge)
Expand Down

0 comments on commit 3f84da0

Please sign in to comment.