Skip to content

Commit a9c1f6f

Browse files
authored
Merge pull request #3 from unum-cloud/dev
Fix: Full model names
2 parents 46b33ca + e934bd5 commit a9c1f6f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ To load the model:
5454
```python
5555
import uform
5656

57-
model = uform.get_model('english')
58-
model = uform.get_model('multilingual')
57+
model = uform.get_model('unum-cloud/uform-vl-english')
58+
model = uform.get_model('unum-cloud/uform-vl-multilingual')
5959
```
6060

61+
You can also load your own Mid-fusion model. Just upload it on HuggingFace and pass model name to `get_model`.
62+
6163
To encode data:
6264

6365
```python

src/uform.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def get_matching_scores(
161161
def _logit_and_norm(self, embeddings):
162162
logits = self.clf_head(embeddings)
163163
if self.head_one_neuron:
164-
return torch.sigmoid(logits)
164+
return torch.sigmoid(logits)[:, 0]
165165

166166
return F.softmax(logits, dim=1)[:, 1]
167167

@@ -336,7 +336,7 @@ def preprocess_text(self, x):
336336

337337
def get_model(model_name, token=None):
338338
model_path = snapshot_download(
339-
repo_id=f'unum-cloud/uform-vl-{model_name}',
339+
repo_id=model_name,
340340
token=token
341341
)
342342
config_path = f'{model_path}/config.json'

0 commit comments

Comments
 (0)