ShAnSantosh commited on
Commit
fa9404a
1 Parent(s): fafaccd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -32,8 +32,8 @@ model = NeuralNet(input_size, hidden_size, output_size).to(device)
32
  model.load_state_dict(model_state)
33
  model.eval()
34
  #test
35
- def predict(sentence, history=[]):
36
- history =[]
37
  """
38
  # tokenize the new input sentence
39
  new_user_input_ids = tokenizer.encode(input + tokenizer.eos_token, return_tensors='pt')
@@ -66,8 +66,7 @@ def predict(sentence, history=[]):
66
  if tag == intent["tag"]:
67
  reply = [random.choice(intent['responses'])]
68
  history.append((sentence, reply))
69
- response = [(history[i], history[i+1]) for i in range(0, len(history)-1, 2)]
70
- return response, history
71
 
72
  import gradio as gr
73
 
 
32
  model.load_state_dict(model_state)
33
  model.eval()
34
  #test
35
+ def predict(sentence, history):
36
+ history = history
37
  """
38
  # tokenize the new input sentence
39
  new_user_input_ids = tokenizer.encode(input + tokenizer.eos_token, return_tensors='pt')
 
66
  if tag == intent["tag"]:
67
  reply = [random.choice(intent['responses'])]
68
  history.append((sentence, reply))
69
+ return history, history
 
70
 
71
  import gradio as gr
72