not-lain commited on
Commit
23e06d0
β€’
1 Parent(s): e82c570

🌘wπŸŒ–

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -21,7 +21,7 @@ tokenizer = AutoTokenizer.from_pretrained("google/gemma-7b-it", token=token)
21
  device = torch.device("cuda")
22
  model = model.to(device)
23
  RAG = SentenceTransformer("mixedbread-ai/mxbai-embed-large-v1")
24
- TOP_K = 3
25
  HEADER = "\n# RESOURCES:\n"
26
  # prepare data
27
  # since data is too big we will only select the first 3K lines
@@ -50,7 +50,7 @@ def prepare_prompt(query, retrieved_examples):
50
  urls = retrieved_examples["url"][::-1]
51
  titles = titles[::-1]
52
  for i in range(TOP_K):
53
- prompt += f"Title: {titles[i]}, Text: {texts[i]}\n"
54
  return prompt, zip(titles, urls)
55
 
56
 
 
21
  device = torch.device("cuda")
22
  model = model.to(device)
23
  RAG = SentenceTransformer("mixedbread-ai/mxbai-embed-large-v1")
24
+ TOP_K = 2
25
  HEADER = "\n# RESOURCES:\n"
26
  # prepare data
27
  # since data is too big we will only select the first 3K lines
 
50
  urls = retrieved_examples["url"][::-1]
51
  titles = titles[::-1]
52
  for i in range(TOP_K):
53
+ prompt += f"* {texts[i]}\n"
54
  return prompt, zip(titles, urls)
55
 
56