from flask import Flask, request, jsonify from transformers import pipeline app = Flask(__name__) model = pipeline('text-generation', model='Erfan11/Neuracraft') @app.route('/generate', methods=['POST']) def generate_text(): input_text = request.json.get('input_text', '') result = model(input_text, max_length=100) return jsonify(result) if __name__ == '__main__': app.run(debug=True, host='0.0.0.0', port=5000)