tomaarsen HF staff commited on
Commit
ba484e1
1 Parent(s): 75e737b

Use Markdown interspersed with HTML rather than pure HTML

Browse files
Files changed (1) hide show
  1. README.md +27 -64
README.md CHANGED
@@ -6,54 +6,28 @@ colorTo: red
6
  sdk: static
7
  pinned: false
8
  ---
9
- <div class="lg:col-span-3">
10
- <p class="mb-4">
11
- SentenceTransformers 🤗 is a Python framework for state-of-the-art sentence, text and image embeddings.
12
- </p>
13
- <p class="mb-4">
14
- Install the <a
15
- href="https://www.sbert.net/"
16
- >Sentence Transformers</a
17
- >
18
- library.
19
- </p>
20
- <div
21
- class="p-4 bg-gradient-to-b from-gray-50-to-white border border-gray-100 rounded-lg relative mb-4"
22
- >
23
- <pre class="break-words leading-1 whitespace-pre-line text-xs md:text-sm text-gray-800">
24
- pip install -U sentence-transformers
25
- </pre>
26
- </div>
27
- </p>
28
- <div class="lg:col-span-3">
29
- <p class="mb-4">
30
- The usage is as simple as:
31
- </p>
32
- <div
33
- class="p-4 bg-gradient-to-b from-gray-50-to-white border border-gray-100 rounded-lg relative mb-4"
34
- >
35
- <pre class="break-words leading-1 whitespace-pre-line text-xs md:text-sm text-gray-800">
36
  from sentence_transformers import SentenceTransformer
37
  model = SentenceTransformer('paraphrase-MiniLM-L6-v2')
38
 
39
- #Sentences we want to encode. Example:
40
  sentence = ['This framework generates embeddings for each input sentence']
41
 
42
- #Sentences are encoded by calling model.encode()
43
  embedding = model.encode(sentence)
44
- </pre>
45
- </div>
46
- </div>
47
- </div>
48
  <div class="grid lg:grid-cols-3 gap-x-4 gap-y-7">
49
- <div class="lg:col-span-3">
50
- <p class="mb-4">
51
- Hugging Face makes it easy to collaboratively build and showcase your <a
52
- href="https://www.sbert.net/">Sentence Transformers</a
53
- >
54
- models! You can collaborate with your organization, upload and showcase your own models in your profile ❤️
55
- </p>
56
- </div>
57
  <a href="https://www.sbert.net/" class="block overflow-hidden group">
58
  <div
59
  class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center bg-[#FA8072]"
@@ -63,7 +37,7 @@ embedding = model.encode(sentence)
63
  <div class="underline">Documentation</div>
64
  </a>
65
  <a
66
- href="https://github.com/UKPLab/sentence-transformers/blob/master/sentence_transformers/SentenceTransformer.py#L417"
67
  class="block overflow-hidden group"
68
  >
69
  <div
@@ -92,25 +66,14 @@ embedding = model.encode(sentence)
92
  </div>
93
  <div class="underline">Find all Sentence Transformers models on the 🤗 Hub</div>
94
  </a>
95
- <div class="lg:col-span-3">
96
- <p class="mb-4">
97
- To upload your Sentence Transformers models to the Hugging Face Hub log in with <code class="language-python">huggingface-cli login</code> and then use the <a
98
- href="https://github.com/UKPLab/sentence-transformers/blob/master/sentence_transformers/SentenceTransformer.py#L417"
99
- >save_to_hub</a
100
- >
101
- function within the Sentence Transformers library.
102
- </p>
103
- <div
104
- class="p-4 bg-gradient-to-b from-gray-50-to-white border border-gray-100 rounded-lg relative mb-4"
105
- >
106
- <pre
107
- class="break-words leading-1 whitespace-pre-line text-xs md:text-sm text-gray-800">
108
- from sentence_transformers import SentenceTransformer
109
- # Load or train a model
110
- model = ...
111
- # Push to Hub
112
- model.save_to_hub("my_new_model")
113
- </pre>
114
- </div>
115
- </p>
116
- </div>
 
6
  sdk: static
7
  pinned: false
8
  ---
9
+ SentenceTransformers 🤗 is a Python framework for state-of-the-art sentence, text and image embeddings.
10
+
11
+ Install the [Sentence Transformers](https://www.sbert.net/) library.
12
+ ```
13
+ pip install -U sentence-transformers
14
+ ```
15
+
16
+ The usage is as simple as:
17
+ ```python
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  from sentence_transformers import SentenceTransformer
19
  model = SentenceTransformer('paraphrase-MiniLM-L6-v2')
20
 
21
+ # Sentences we want to encode. Example:
22
  sentence = ['This framework generates embeddings for each input sentence']
23
 
24
+ # Sentences are encoded by calling model.encode()
25
  embedding = model.encode(sentence)
26
+ ```
27
+
28
+ Hugging Face makes it easy to collaboratively build and showcase your [Sentence Transformers](https://www.sbert.net/) models! You can collaborate with your organization, upload and showcase your own models in your profile ❤️
29
+
30
  <div class="grid lg:grid-cols-3 gap-x-4 gap-y-7">
 
 
 
 
 
 
 
 
31
  <a href="https://www.sbert.net/" class="block overflow-hidden group">
32
  <div
33
  class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center bg-[#FA8072]"
 
37
  <div class="underline">Documentation</div>
38
  </a>
39
  <a
40
+ href="https://sbert.net/docs/package_reference/SentenceTransformer.html#sentence_transformers.SentenceTransformer.save_to_hub"
41
  class="block overflow-hidden group"
42
  >
43
  <div
 
66
  </div>
67
  <div class="underline">Find all Sentence Transformers models on the 🤗 Hub</div>
68
  </a>
69
+ </div>
70
+
71
+ To upload your Sentence Transformers models to the Hugging Face Hub, log in with `huggingface-cli login` and use the [`save_to_hub`](https://sbert.net/docs/package_reference/SentenceTransformer.html#sentence_transformers.SentenceTransformer.save_to_hub) method within the Sentence Transformers library.
72
+ ```python
73
+ from sentence_transformers import SentenceTransformer
74
+
75
+ # Load or train a model
76
+ model = SentenceTransformer(...)
77
+ # Push to Hub
78
+ model.save_to_hub("my_new_model")
79
+ ```