rodrisouza commited on
Commit
020432b
·
verified ·
1 Parent(s): 7196632

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -84,7 +84,7 @@ chat_history = []
84
 
85
  # Function to handle interaction with model
86
  @spaces.GPU
87
- def interact(user_input, history, interaction_count, model_name):
88
  global tokenizer, model
89
  try:
90
  if tokenizer is None or model is None:
@@ -151,7 +151,7 @@ Here is the story:
151
  chat_history = [] # Reset chat history
152
  chat_history.append({"role": "system", "content": combined_message})
153
  question_prompt = "Please ask a simple question about the story to encourage interaction."
154
- _, formatted_history, chat_history, interaction_count = interact(question_prompt, chat_history, interaction_count, model_name)
155
 
156
  return formatted_history, chat_history, gr.update(value=[]), story["story"]
157
  else:
 
84
 
85
  # Function to handle interaction with model
86
  @spaces.GPU
87
+ def interact(user_input, history, interaction_count):
88
  global tokenizer, model
89
  try:
90
  if tokenizer is None or model is None:
 
151
  chat_history = [] # Reset chat history
152
  chat_history.append({"role": "system", "content": combined_message})
153
  question_prompt = "Please ask a simple question about the story to encourage interaction."
154
+ _, formatted_history, chat_history, interaction_count = interact(question_prompt, chat_history, interaction_count)
155
 
156
  return formatted_history, chat_history, gr.update(value=[]), story["story"]
157
  else: