Spaces:
Running
Running
Commit
·
ff30b1f
1
Parent(s):
a44d0c0
Update README.md
Browse files
README.md
CHANGED
@@ -57,68 +57,42 @@ You can collaborate with your organization, upload and showcase your own models
|
|
57 |
</a>
|
58 |
<div class="lg:col-span-3">
|
59 |
<p class="mb-4">
|
60 |
-
To upload your
|
61 |
-
href="https://github.com/
|
62 |
-
>
|
63 |
>
|
64 |
-
function.
|
65 |
</p>
|
66 |
<div
|
67 |
class="p-4 bg-gradient-to-b from-gray-50-to-white border border-gray-100 rounded-lg relative mb-4"
|
68 |
>
|
69 |
<pre
|
70 |
class="break-words leading-1 whitespace-pre-line text-xs md:text-sm text-gray-800">
|
71 |
-
!pip install
|
72 |
!huggingface-cli login
|
73 |
-
from
|
74 |
-
|
75 |
</pre>
|
76 |
</div>
|
77 |
</p>
|
78 |
<div class="lg:col-span-3">
|
79 |
<p class="mb-4">
|
80 |
-
To load
|
81 |
-
href="https://github.com/
|
82 |
-
>
|
83 |
>
|
84 |
-
|
85 |
</p>
|
86 |
<div
|
87 |
class="p-4 bg-gradient-to-b from-gray-50-to-white border border-gray-100 rounded-lg relative mb-4"
|
88 |
>
|
89 |
<pre
|
90 |
class="break-words leading-1 whitespace-pre-line text-xs md:text-sm text-gray-800">
|
91 |
-
!pip install
|
92 |
-
|
93 |
-
|
94 |
-
from_pretrained_keras("your-username/your-awesome-model)
|
95 |
</pre>
|
96 |
</div>
|
97 |
<div class="lg:col-span-1">
|
98 |
-
<p class="mb-4">
|
99 |
-
If you'd like to upload 🤗Transformers based Keras checkpoints and let us host your metrics interactively in the repo in with TensorBoard, use <a
|
100 |
-
href="https://huggingface.co/transformers/v4.12.5/_modules/transformers/keras_callbacks.html#PushToHubCallback"
|
101 |
-
>PushToHubCallback</a
|
102 |
-
>
|
103 |
-
like follows:
|
104 |
-
</p>
|
105 |
-
<div
|
106 |
-
class="p-4 bg-gradient-to-b from-gray-50-to-white border border-gray-100 rounded-lg relative mb-4"
|
107 |
-
>
|
108 |
-
<pre
|
109 |
-
class="break-words leading-1 whitespace-pre-line text-xs md:text-sm text-gray-800">
|
110 |
-
!pip install huggingface-hub
|
111 |
-
!huggingface-cli login
|
112 |
-
from transformers.keras_callbacks import PushToHubCallback
|
113 |
-
from tensorflow.keras.callbacks import TensorBoard
|
114 |
-
tensorboard_callback = TensorBoard(log_dir = "./logs/tensorboard)
|
115 |
-
push_to_hub_callback = PushToHubCallback(output_dir="./logs",
|
116 |
-
tokenizer=tokenizer,
|
117 |
-
hub_model_id=model_id)
|
118 |
-
|
119 |
-
callbacks = [tensorboard_callback, push_to_hub_callback]
|
120 |
-
model.fit(..., callbacks=callbacks, ...)
|
121 |
-
|
122 |
-
</pre>
|
123 |
|
124 |
</div>
|
|
|
57 |
</a>
|
58 |
<div class="lg:col-span-3">
|
59 |
<p class="mb-4">
|
60 |
+
To upload your Sentence Transformers models to the Hub, you can use the <a
|
61 |
+
href="https://github.com/UKPLab/sentence-transformers/blob/master/sentence_transformers/SentenceTransformer.py#L417"
|
62 |
+
>save_to_hub</a
|
63 |
>
|
64 |
+
function within the Sentence Transformers library.
|
65 |
</p>
|
66 |
<div
|
67 |
class="p-4 bg-gradient-to-b from-gray-50-to-white border border-gray-100 rounded-lg relative mb-4"
|
68 |
>
|
69 |
<pre
|
70 |
class="break-words leading-1 whitespace-pre-line text-xs md:text-sm text-gray-800">
|
71 |
+
!pip install -U sentence-transformers
|
72 |
!huggingface-cli login
|
73 |
+
from sentence_transformers import save_to_hub
|
74 |
+
save_to_hub(repo_name = 'cool_new_model')
|
75 |
</pre>
|
76 |
</div>
|
77 |
</p>
|
78 |
<div class="lg:col-span-3">
|
79 |
<p class="mb-4">
|
80 |
+
To load Sentence Transformers models from the 🤗Hub, use the <a
|
81 |
+
href="https://github.com/UKPLab/sentence-transformers/blob/master/sentence_transformers/SentenceTransformer.py#L33"
|
82 |
+
>SentenceTransformer</a
|
83 |
>
|
84 |
+
class.
|
85 |
</p>
|
86 |
<div
|
87 |
class="p-4 bg-gradient-to-b from-gray-50-to-white border border-gray-100 rounded-lg relative mb-4"
|
88 |
>
|
89 |
<pre
|
90 |
class="break-words leading-1 whitespace-pre-line text-xs md:text-sm text-gray-800">
|
91 |
+
!pip install -U sentence-transformers
|
92 |
+
from sentence_transformers import SentenceTransformer
|
93 |
+
model = SentenceTransformer("your-username/your-awesome-model")
|
|
|
94 |
</pre>
|
95 |
</div>
|
96 |
<div class="lg:col-span-1">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
|
98 |
</div>
|