Update app.py
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ def load_memory(filename='chat_memory.pkl'):
|
|
42 |
session_memory = load_memory()
|
43 |
|
44 |
# ---- Response Generation ----
|
45 |
-
def generate_response(prompt, max_length=
|
46 |
inputs = tokenizer(prompt, return_tensors='pt', padding=True, truncation=True, max_length=max_length)
|
47 |
input_ids = inputs['input_ids'].to(device)
|
48 |
attention_mask = inputs['attention_mask'].to(device)
|
|
|
42 |
session_memory = load_memory()
|
43 |
|
44 |
# ---- Response Generation ----
|
45 |
+
def generate_response(prompt, max_length=50):
|
46 |
inputs = tokenizer(prompt, return_tensors='pt', padding=True, truncation=True, max_length=max_length)
|
47 |
input_ids = inputs['input_ids'].to(device)
|
48 |
attention_mask = inputs['attention_mask'].to(device)
|