Lauler commited on
Commit
28b01d0
1 Parent(s): a65f4bc

Update readme load older model info

Browse files
Files changed (1) hide show
  1. README.md +22 -1
README.md CHANGED
@@ -68,6 +68,20 @@ embeddings = model.encode(sentences)
68
  print(embeddings)
69
  ```
70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
 
73
  ## Usage (HuggingFace Transformers)
@@ -107,7 +121,14 @@ print("Sentence embeddings:")
107
  print(sentence_embeddings)
108
  ```
109
 
110
- To load an older model specify the version tag with the `revision` arg: `AutoTokenizer.from_pretrained('KBLab/sentence-bert-swedish-cased', revision="v1.0")`.
 
 
 
 
 
 
 
111
 
112
  ## Evaluation Results
113
 
 
68
  print(embeddings)
69
  ```
70
 
71
+ ### Loading an older model version (Sentence-Transformers)
72
+
73
+ Currently, the easiest way to load an older model version is to clone the model repository and load it from disk. For example, to clone the **v1.0** model:
74
+
75
+ ```bash
76
+ git clone --depth 1 --branch v1.0 https://huggingface.co/KBLab/sentence-bert-swedish-cased
77
+ ```
78
+
79
+ Then you can load the model by pointing to the local folder where you cloned the model:
80
+
81
+ ```python
82
+ from sentence_transformers import SentenceTransformer
83
+ model = SentenceTransformer("path_to_model_folder/sentence-bert-swedish-cased")
84
+ ```
85
 
86
 
87
  ## Usage (HuggingFace Transformers)
 
121
  print(sentence_embeddings)
122
  ```
123
 
124
+ ### Loading an older model (Hugginfface Transformers)
125
+
126
+ To load an older model specify the version tag with the `revision` arg. For example, to load the **v1.0** model, use the following code:
127
+
128
+ ```python
129
+ AutoTokenizer.from_pretrained('KBLab/sentence-bert-swedish-cased', revision="v1.0")
130
+ AutoModel.from_pretrained('KBLab/sentence-bert-swedish-cased', revision="v1.0")
131
+ ```
132
 
133
  ## Evaluation Results
134