Spaces:
Runtime error
Runtime error
Update app.py
Browse files242 unmodified lines243244245246247248249250251252253254255256257258259260261262242 unmodified linesthread.start()return "OK", 200@flask_app.route("/upload", methods=["GET", "POST"])def upload():if request.method == "POST":file = request.files.get("file")if not file:return "No file uploaded", 400file_path = os.path.join(UPLOAD_FOLDER, file.filename)file.save(file_path)# Reinitialize the agent_app using the uploaded file's path.global agent_appagent_app = create_agent_app(file_path)socketio.emit("log", {"message": f"[INFO]: Database file '{file.filename}' uploaded and loaded."})return redirect(url_for("index"))return render_template("upload.html")return flask_app, socketio242 unmodified lines243244245246247248249250251252253254255256257258259260261262263242 unmodified linesthread.start()return "OK", 200@flask_app.route("/upload", methods=["POST"])def upload():file = request.files.get("file")if not file:return "No file uploaded", 400file_path = os.path.join(UPLOAD_FOLDER, file.filename)file.save(file_path)# Initialize new agent app using file pathglobal agent_appagent_app = create_agent_app(file_path)socketio.emit("log", {"message": f"[INFO]: Database file '{file.filename}' uploaded and loaded."})return redirect(url_for("index")) # Go back to index pagereturn flask_app, socketio
app.py+14-13