gyuhwung-cho commited on
Commit
de5b7fa
·
verified ·
1 Parent(s): 15d683f

README: library_name -> sentence-transformers; human-readable tokens in decode snippet

Browse files
Files changed (1) hide show
  1. README.md +3 -3
README.md CHANGED
@@ -11,7 +11,7 @@ tags:
11
  - inference-free
12
  - sentence-transformers
13
  pipeline_tag: feature-extraction
14
- library_name: transformers
15
  ---
16
 
17
  <p align="center">
@@ -98,8 +98,8 @@ print(similarities)
98
 
99
  # Inspect the top activated tokens of the page image
100
  decoded = model.decode(document_embeddings[0], top_k=5)
101
- print([(token, round(weight, 3)) for token, weight in decoded])
102
- # [('Ġdog', 1.836), ('Ġdogs', 1.664), ('Ġpuppy', 1.586), ('ĠRecords', 1.578), ('ĠBennett', 1.508)]
103
  ```
104
 
105
  Images can be passed as PIL images, local paths, URLs (as above), or together with text as `{"image": ..., "text": ...}`. Plain text documents are also supported: `model.encode_document(["some passage text"])`. The model runs in bfloat16 by default. You can pass `model_kwargs={"torch_dtype": "float32"}` for full precision.
 
11
  - inference-free
12
  - sentence-transformers
13
  pipeline_tag: feature-extraction
14
+ library_name: sentence-transformers
15
  ---
16
 
17
  <p align="center">
 
98
 
99
  # Inspect the top activated tokens of the page image
100
  decoded = model.decode(document_embeddings[0], top_k=5)
101
+ print([(token.replace("Ġ", " ").strip(), round(weight, 3)) for token, weight in decoded])
102
+ # [('dog', 1.836), ('dogs', 1.664), ('puppy', 1.586), ('Records', 1.578), ('Bennett', 1.508)]
103
  ```
104
 
105
  Images can be passed as PIL images, local paths, URLs (as above), or together with text as `{"image": ..., "text": ...}`. Plain text documents are also supported: `model.encode_document(["some passage text"])`. The model runs in bfloat16 by default. You can pass `model_kwargs={"torch_dtype": "float32"}` for full precision.