ayush-thakur02 commited on
Commit
194076d
·
verified ·
1 Parent(s): 5227ac1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -32,7 +32,7 @@ def find_most_similar(sentence, candidates, threshold=0.15):
32
  similar_sentences = []
33
  for i, score in enumerate(similarity_scores):
34
  if score >= threshold:
35
- similar_sentences.append({"sentence": candidates[i], "similarity_score": round(score, 4)})
36
 
37
  return similar_sentences
38
 
@@ -51,13 +51,13 @@ def fetch_vectors(file, sentence):
51
  # Interface
52
  file_uploader = gr.File(label="Upload a .txt file")
53
  text_input = gr.Textbox(label="Enter a sentence")
54
- output_text = gr.Textbox(label="Similar Sentences JSON")
55
 
56
  iface = gr.Interface(
57
  fn=fetch_vectors,
58
  inputs=[file_uploader, text_input],
59
  outputs=output_text,
60
- title="Simple RAG - For QA",
61
  description="Upload a text file and enter the question. The threshold is set to 0.15."
62
  )
63
 
 
32
  similar_sentences = []
33
  for i, score in enumerate(similarity_scores):
34
  if score >= threshold:
35
+ similar_sentences.append({"sentence": candidates[i], "f(score)": round(score, 4)})
36
 
37
  return similar_sentences
38
 
 
51
  # Interface
52
  file_uploader = gr.File(label="Upload a .txt file")
53
  text_input = gr.Textbox(label="Enter a sentence")
54
+ output_text = gr.Textbox(label="RAG -QA")
55
 
56
  iface = gr.Interface(
57
  fn=fetch_vectors,
58
  inputs=[file_uploader, text_input],
59
  outputs=output_text,
60
+ title="Minimal RAG - For QA (Super Fast/Modeless)",
61
  description="Upload a text file and enter the question. The threshold is set to 0.15."
62
  )
63