Adr740 commited on
Commit
0f96e61
·
1 Parent(s): 5b8c1c1

Update get_similar_hadiths.py

Browse files
Files changed (1) hide show
  1. get_similar_hadiths.py +2 -2
get_similar_hadiths.py CHANGED
@@ -21,7 +21,7 @@ class HadithSearch:
21
  messages=[
22
  {
23
  "role": "system",
24
- "content": "Your task is to transform a described situation into a list of the top 3 most important things to look for in a database of Islamic hadith that could be helpful to bring answers. It should be formatted with only the list and no opinion from you. The goal is to use this list to perform cosine similarity embedding search on the hadith database. You provide this list in French"
25
  },
26
  {
27
  "role": "user",
@@ -34,7 +34,7 @@ class HadithSearch:
34
  frequency_penalty=0,
35
  presence_penalty=0
36
  ).choices[0].message.content
37
- return self.client.embeddings.create(input=f"{response}\nSituation en question: \n{text}", model=model).data[0].embedding
38
 
39
  def load_data_from_json(self, json_file):
40
  self.data = pd.read_json(json_file)
 
21
  messages=[
22
  {
23
  "role": "system",
24
+ "content": "Your task is to transform a described situation into a list of the top 3 most important things to look for in a database of Islamic hadith that could be helpful to bring answers. It should be very specific and formatted with only the list and no opinion from you. The goal is to use this list to perform cosine similarity embedding search on the hadith database. You provide this list in French"
25
  },
26
  {
27
  "role": "user",
 
34
  frequency_penalty=0,
35
  presence_penalty=0
36
  ).choices[0].message.content
37
+ return self.client.embeddings.create(input=f"{response}", model=model).data[0].embedding
38
 
39
  def load_data_from_json(self, json_file):
40
  self.data = pd.read_json(json_file)