Spaces:
Configuration error
Configuration error
Update app.py
Browse files
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):
|
88 |
global tokenizer, model
|
89 |
try:
|
90 |
if tokenizer is None or model is None:
|
@@ -148,7 +148,7 @@ Here is the story:
|
|
148 |
chat_history = [] # Reset chat history
|
149 |
chat_history.append({"role": "system", "content": combined_message})
|
150 |
question_prompt = "Please ask a simple question about the story to encourage interaction."
|
151 |
-
_, formatted_history, chat_history, interaction_count = interact(question_prompt, chat_history, interaction_count)
|
152 |
|
153 |
return formatted_history, chat_history, gr.update(value=[]), story["story"]
|
154 |
else:
|
|
|
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:
|
|
|
148 |
chat_history = [] # Reset chat history
|
149 |
chat_history.append({"role": "system", "content": combined_message})
|
150 |
question_prompt = "Please ask a simple question about the story to encourage interaction."
|
151 |
+
_, formatted_history, chat_history, interaction_count = interact(question_prompt, chat_history, interaction_count, model_name)
|
152 |
|
153 |
return formatted_history, chat_history, gr.update(value=[]), story["story"]
|
154 |
else:
|