Spaces:
Sleeping
Sleeping
Turning off memory
Browse files
app.py
CHANGED
|
@@ -32,11 +32,11 @@ def chat_with_distilgpt2(input_text):
|
|
| 32 |
conversation_history = memory.load_memory_variables({})['history']
|
| 33 |
|
| 34 |
# Combine the (possibly summarized) history with the current user input
|
| 35 |
-
full_input = f"{conversation_history}\nUser: {input_text}\nAssistant:"
|
| 36 |
no_memory_input = f"Question: {input_text}\nAnswer:"
|
| 37 |
|
| 38 |
# Tokenize the input and convert to tensor
|
| 39 |
-
input_ids = tokenizer.encode(
|
| 40 |
|
| 41 |
# Generate the response using the model with adjusted parameters
|
| 42 |
outputs = model.generate(
|
|
|
|
| 32 |
conversation_history = memory.load_memory_variables({})['history']
|
| 33 |
|
| 34 |
# Combine the (possibly summarized) history with the current user input
|
| 35 |
+
#full_input = f"{conversation_history}\nUser: {input_text}\nAssistant:"
|
| 36 |
no_memory_input = f"Question: {input_text}\nAnswer:"
|
| 37 |
|
| 38 |
# Tokenize the input and convert to tensor
|
| 39 |
+
input_ids = tokenizer.encode(no_memory_input, return_tensors="pt").to(device)
|
| 40 |
|
| 41 |
# Generate the response using the model with adjusted parameters
|
| 42 |
outputs = model.generate(
|