Spaces:
Running
on
Zero
Running
on
Zero
πwπ
Browse files
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 =
|
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"
|
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 |
|