kdevoe commited on
Commit
4d1575b
·
verified ·
1 Parent(s): 2c5cee9

Turning off memory

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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(full_input, return_tensors="pt").to(device)
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(