mirianokradze commited on
Commit
01090d7
·
verified ·
1 Parent(s): d1df9ea

Use news questions in the usage examples

Browse files
Files changed (1) hide show
  1. README.md +13 -6
README.md CHANGED
@@ -61,10 +61,13 @@ from sentence_transformers import SentenceTransformer
61
 
62
  model = SentenceTransformer("desearch/Desearch-Embedding-8B")
63
 
64
- queries = ["When did the James Webb Space Telescope launch?"]
 
 
 
65
  documents = [
66
- "The James Webb Space Telescope launched on 25 December 2021 on an Ariane 5 rocket from Kourou, French Guiana.",
67
- "The Hubble Space Telescope was carried into orbit by the Space Shuttle Discovery in April 1990.",
68
  ]
69
 
70
  query_embeddings = model.encode(queries, prompt_name="query")
@@ -83,10 +86,14 @@ from peft import PeftModel
83
  from transformers import AutoModel, AutoTokenizer
84
 
85
  task = "Given a web search query, retrieve relevant passages that answer the query"
86
- queries = [f"Instruct: {task}\nQuery:When did the James Webb Space Telescope launch?"]
 
 
 
 
87
  documents = [
88
- "The James Webb Space Telescope launched on 25 December 2021 on an Ariane 5 rocket from Kourou, French Guiana.",
89
- "The Hubble Space Telescope was carried into orbit by the Space Shuttle Discovery in April 1990.",
90
  ]
91
 
92
  tokenizer = AutoTokenizer.from_pretrained("desearch/Desearch-Embedding-8B", padding_side="left")
 
61
 
62
  model = SentenceTransformer("desearch/Desearch-Embedding-8B")
63
 
64
+ queries = [
65
+ "Who became Apple’s chief executive and will lead the Sept. 9, 2026 “Surprise and Shine” product event?",
66
+ "How much does the base Mac Mini M6 cost in US dollars as of its August 2026 announcement?",
67
+ ]
68
  documents = [
69
+ "John Ternus, Apple's new chief executive, takes the stage at the September 9, 2026 “Surprise and Shine” event to unveil the latest iPhones and Apple Watches.",
70
+ "Apple surprised buyers in late August 2026 with the Mac Mini M6 at $899 and the Mac Mini M5 Pro at $1,699, both shipping on September 22.",
71
  ]
72
 
73
  query_embeddings = model.encode(queries, prompt_name="query")
 
86
  from transformers import AutoModel, AutoTokenizer
87
 
88
  task = "Given a web search query, retrieve relevant passages that answer the query"
89
+ questions = [
90
+ "Who became Apple’s chief executive and will lead the Sept. 9, 2026 “Surprise and Shine” product event?",
91
+ "How much does the base Mac Mini M6 cost in US dollars as of its August 2026 announcement?",
92
+ ]
93
+ queries = [f"Instruct: {task}\nQuery:{q}" for q in questions]
94
  documents = [
95
+ "John Ternus, Apple's new chief executive, takes the stage at the September 9, 2026 “Surprise and Shine” event to unveil the latest iPhones and Apple Watches.",
96
+ "Apple surprised buyers in late August 2026 with the Mac Mini M6 at $899 and the Mac Mini M5 Pro at $1,699, both shipping on September 22.",
97
  ]
98
 
99
  tokenizer = AutoTokenizer.from_pretrained("desearch/Desearch-Embedding-8B", padding_side="left")