Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,13 +20,16 @@ system_propmpt = "You are a friendly Chatbot."
|
|
20 |
Settings.llm = HuggingFaceLLM(model_name="facebook/blenderbot-400M-distill",
|
21 |
device_map="cpu",
|
22 |
system_prompt = system_propmpt,
|
23 |
-
context_window=
|
|
|
|
|
|
|
24 |
tokenizer_kwargs={"max_length": 4096},
|
25 |
-
tokenizer_name="facebook/blenderbot-400M-distill"
|
26 |
)
|
27 |
Settings.embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-small-en-v1.5")
|
28 |
documents = [Document(text="Indian parliament elections happened in April-May 2024. BJP Party won."),
|
29 |
-
Document(text="Indian parliament elections happened in April-May 2021. XYZ Party won.",
|
30 |
Document(text="Indian parliament elections happened in 2020. ABC Party won."),
|
31 |
]
|
32 |
index = VectorStoreIndex.from_documents(
|
|
|
20 |
Settings.llm = HuggingFaceLLM(model_name="facebook/blenderbot-400M-distill",
|
21 |
device_map="cpu",
|
22 |
system_prompt = system_propmpt,
|
23 |
+
context_window=4096,
|
24 |
+
max_new_tokens=256,
|
25 |
+
stopping_ids=[50278, 50279, 50277, 1, 0],
|
26 |
+
generate_kwargs={"temperature": 0.7, "do_sample": False},
|
27 |
tokenizer_kwargs={"max_length": 4096},
|
28 |
+
tokenizer_name="facebook/blenderbot-400M-distill",
|
29 |
)
|
30 |
Settings.embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-small-en-v1.5")
|
31 |
documents = [Document(text="Indian parliament elections happened in April-May 2024. BJP Party won."),
|
32 |
+
Document(text="Indian parliament elections happened in April-May 2021. XYZ Party won."),
|
33 |
Document(text="Indian parliament elections happened in 2020. ABC Party won."),
|
34 |
]
|
35 |
index = VectorStoreIndex.from_documents(
|