File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -54,10 +54,12 @@ To load the model:
54
54
``` python
55
55
import uform
56
56
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' )
59
59
```
60
60
61
+ You can also load your own Mid-fusion model. Just upload it on HuggingFace and pass model name to ` get_model ` .
62
+
61
63
To encode data:
62
64
63
65
``` python
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ def get_matching_scores(
161
161
def _logit_and_norm (self , embeddings ):
162
162
logits = self .clf_head (embeddings )
163
163
if self .head_one_neuron :
164
- return torch .sigmoid (logits )
164
+ return torch .sigmoid (logits )[:, 0 ]
165
165
166
166
return F .softmax (logits , dim = 1 )[:, 1 ]
167
167
@@ -336,7 +336,7 @@ def preprocess_text(self, x):
336
336
337
337
def get_model (model_name , token = None ):
338
338
model_path = snapshot_download (
339
- repo_id = f'unum-cloud/uform-vl- { model_name } ' ,
339
+ repo_id = model_name ,
340
340
token = token
341
341
)
342
342
config_path = f'{ model_path } /config.json'
You can’t perform that action at this time.
0 commit comments