Saif Rehman Nasir
commited on
Commit
•
a2ff208
1
Parent(s):
f7e22b6
Change model to zephyr
Browse files
rag.py
CHANGED
@@ -22,13 +22,13 @@ NEO4J_PASSWORD = os.getenv("NEO4J_PASSWORD")
|
|
22 |
vector_index = os.getenv("VECTOR_INDEX")
|
23 |
|
24 |
chat_llm = HuggingFaceEndpoint(
|
25 |
-
repo_id="
|
26 |
task="text-generation",
|
27 |
max_new_tokens=4096,
|
28 |
do_sample=False,
|
29 |
)
|
30 |
|
31 |
-
global_tokenizer = AutoTokenizer.from_pretrained("meta-llama/Meta-Llama-3-8B-Instruct")
|
32 |
|
33 |
|
34 |
def local_retriever(query: str):
|
@@ -276,9 +276,8 @@ def global_retriever(query: str, level: int, response_type: str):
|
|
276 |
i += 1
|
277 |
|
278 |
###Debug####
|
279 |
-
|
280 |
-
tokens
|
281 |
-
print(f"Number of input tokens: {len(tokens)}")
|
282 |
###Debug###
|
283 |
final_response = reduce_chain.invoke(
|
284 |
{
|
|
|
22 |
vector_index = os.getenv("VECTOR_INDEX")
|
23 |
|
24 |
chat_llm = HuggingFaceEndpoint(
|
25 |
+
repo_id="HuggingFaceH4/zephyr-7b-beta",
|
26 |
task="text-generation",
|
27 |
max_new_tokens=4096,
|
28 |
do_sample=False,
|
29 |
)
|
30 |
|
31 |
+
# global_tokenizer = AutoTokenizer.from_pretrained("meta-llama/Meta-Llama-3-8B-Instruct")
|
32 |
|
33 |
|
34 |
def local_retriever(query: str):
|
|
|
276 |
i += 1
|
277 |
|
278 |
###Debug####
|
279 |
+
# tokens = global_tokenizer(intermediate_results)
|
280 |
+
# print(f"Number of input tokens: {len(tokens)}")
|
|
|
281 |
###Debug###
|
282 |
final_response = reduce_chain.invoke(
|
283 |
{
|