michael-guenther
commited on
Commit
•
a252178
1
Parent(s):
f49335d
Update README.md
Browse files
README.md
CHANGED
@@ -1200,7 +1200,7 @@ from sentence_transformers import SentenceTransformer
|
|
1200 |
from sentence_transformers.util import cos_sim
|
1201 |
|
1202 |
model = SentenceTransformer(
|
1203 |
-
"jinaai/jina-embeddings-v2-base-
|
1204 |
trust_remote_code=True
|
1205 |
)
|
1206 |
|
@@ -1209,7 +1209,7 @@ model.max_seq_length = 1024
|
|
1209 |
|
1210 |
embeddings = model.encode([
|
1211 |
'How is the weather today?',
|
1212 |
-
'
|
1213 |
])
|
1214 |
print(cos_sim(embeddings[0], embeddings[1]))
|
1215 |
```
|
@@ -1235,7 +1235,7 @@ If you forgot to pass the `trust_remote_code=True` flag when calling `AutoModel.
|
|
1235 |
This is caused by tranformers falling back to creating a default BERT model, instead of a jina-embedding model:
|
1236 |
|
1237 |
```bash
|
1238 |
-
Some weights of the model checkpoint at jinaai/jina-embeddings-v2-base-
|
1239 |
```
|
1240 |
|
1241 |
**User is not logged into Huggingface**
|
@@ -1244,7 +1244,7 @@ The model is only availabe under [gated access](https://huggingface.co/docs/hub/
|
|
1244 |
This means you need to be logged into huggingface load load it.
|
1245 |
If you receive the following error, you need to provide an access token, either by using the huggingface-cli or providing the token via an environment variable as described above:
|
1246 |
```bash
|
1247 |
-
OSError: jinaai/jina-embeddings-v2-base-
|
1248 |
If this is a private repository, make sure to pass a token having permission to this repo with `use_auth_token` or log in with `huggingface-cli login` and pass `use_auth_token=True`.
|
1249 |
```
|
1250 |
|
|
|
1200 |
from sentence_transformers.util import cos_sim
|
1201 |
|
1202 |
model = SentenceTransformer(
|
1203 |
+
"jinaai/jina-embeddings-v2-base-zh", # switch to en/zh for English or Chinese
|
1204 |
trust_remote_code=True
|
1205 |
)
|
1206 |
|
|
|
1209 |
|
1210 |
embeddings = model.encode([
|
1211 |
'How is the weather today?',
|
1212 |
+
'今天天气怎么样?'
|
1213 |
])
|
1214 |
print(cos_sim(embeddings[0], embeddings[1]))
|
1215 |
```
|
|
|
1235 |
This is caused by tranformers falling back to creating a default BERT model, instead of a jina-embedding model:
|
1236 |
|
1237 |
```bash
|
1238 |
+
Some weights of the model checkpoint at jinaai/jina-embeddings-v2-base-zh were not used when initializing BertModel: ['encoder.layer.2.mlp.layernorm.weight', 'encoder.layer.3.mlp.layernorm.weight', 'encoder.layer.10.mlp.wo.bias', 'encoder.layer.5.mlp.wo.bias', 'encoder.layer.2.mlp.layernorm.bias', 'encoder.layer.1.mlp.gated_layers.weight', 'encoder.layer.5.mlp.gated_layers.weight', 'encoder.layer.8.mlp.layernorm.bias', ...
|
1239 |
```
|
1240 |
|
1241 |
**User is not logged into Huggingface**
|
|
|
1244 |
This means you need to be logged into huggingface load load it.
|
1245 |
If you receive the following error, you need to provide an access token, either by using the huggingface-cli or providing the token via an environment variable as described above:
|
1246 |
```bash
|
1247 |
+
OSError: jinaai/jina-embeddings-v2-base-zh is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
|
1248 |
If this is a private repository, make sure to pass a token having permission to this repo with `use_auth_token` or log in with `huggingface-cli login` and pass `use_auth_token=True`.
|
1249 |
```
|
1250 |
|