gradio-server / flask.py.save
caffeinatedcherrychic's picture
Upload folder using huggingface_hub
db328d1 verified
raw
history blame contribute delete
444 Bytes
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)