Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -269,14 +269,14 @@ def create_app():
|
|
269 |
db_path = os.path.join(app.config['UPLOAD_FOLDER'], 'uploaded.db')
|
270 |
file.save(db_path)
|
271 |
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
return render_template("upload.html")
|
281 |
|
282 |
return flask_app, socketio
|
|
|
269 |
db_path = os.path.join(app.config['UPLOAD_FOLDER'], 'uploaded.db')
|
270 |
file.save(db_path)
|
271 |
|
272 |
+
# Convert the file path to an absolute path and reinitialize the agent_app
|
273 |
+
abs_file_path = os.path.abspath(db_path)
|
274 |
+
global agent_app
|
275 |
+
agent_app = create_agent_app(abs_file_path)
|
276 |
+
print("agent app",agent_app)
|
277 |
+
print("[INFO_PRINT]: Database file '{file.filename}' uploaded and loaded.")
|
278 |
+
socketio.emit("log", {"message": f"[INFO]: Database file '{file.filename}' uploaded and loaded."})
|
279 |
+
return redirect(url_for("index")) # Go back to index page
|
280 |
return render_template("upload.html")
|
281 |
|
282 |
return flask_app, socketio
|