from flask import Flask, request, jsonify import gradio as gr app = Flask(__name__) def my_gradio_function(input_text): # Your processing logic here return "Processed: " + input_text @app.route("/process", methods=["POST"]) def process(): input_text = request.json["input_text"] output_text = my_gradio_function(input_text) return jsonify({"output_text": output_text}) if __name__ == "__main__": app.run(port=5000)