vjain commited on
Commit
6195c27
1 Parent(s): 8521103

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -30,8 +30,8 @@ def reply(input):
30
 
31
  input = input
32
  input_vector = generate_embeddings(input, model_id,hf_token)
33
- df["similiarities"]=df["embedding"].apply(lambda x: cosine_similarity([x],[input_vector])[0][0])
34
- data = df.sort_values("similiarities", ascending=False).head(10)
35
  data.to_csv("sorted.csv")
36
  context = []
37
  for i, row in data.iterrows():
@@ -40,7 +40,7 @@ def reply(input):
40
  text = "\n".join(context)
41
  context = text
42
  prompt = f"""
43
- Answer the following question If you don't know the answer for certain, say I don't know.
44
  Context: {context}
45
 
46
  Q: {input}
 
30
 
31
  input = input
32
  input_vector = generate_embeddings(input, model_id,hf_token)
33
+ df["similarities"]=df["embedding"].apply(lambda x: cosine_similarity([x],[input_vector])[0][0])
34
+ data = df.sort_values("similarities", ascending=False).head(10)
35
  data.to_csv("sorted.csv")
36
  context = []
37
  for i, row in data.iterrows():
 
40
  text = "\n".join(context)
41
  context = text
42
  prompt = f"""
43
+ Answer the following question using the context given below.If you don't know the answer for certain, say I don't know.
44
  Context: {context}
45
 
46
  Q: {input}