Update app.py
Browse files
app.py
CHANGED
|
@@ -41,13 +41,14 @@ def get_vectorstore(text_chunks):
|
|
| 41 |
def get_conversation_chain(vectorstore):
|
| 42 |
# Using a lightweight LLM, e.g., distilgpt2 or distilbart
|
| 43 |
llm = HuggingFaceEndpoint(
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
)
|
|
|
|
| 51 |
|
| 52 |
|
| 53 |
memory = ConversationBufferMemory(
|
|
|
|
| 41 |
def get_conversation_chain(vectorstore):
|
| 42 |
# Using a lightweight LLM, e.g., distilgpt2 or distilbart
|
| 43 |
llm = HuggingFaceEndpoint(
|
| 44 |
+
repo_id="distilgpt2", # Low-end model (DistilGPT2)
|
| 45 |
+
temperature=0.7, # Adjusted for balanced creativity
|
| 46 |
+
max_new_tokens=100, # Limiting response length
|
| 47 |
+
top_p=0.9, # Nucleus sampling
|
| 48 |
+
top_k=50, # Limit token options during generation
|
| 49 |
+
repetition_penalty=1.0 # Default value to prevent repetition
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
|
| 53 |
|
| 54 |
memory = ConversationBufferMemory(
|