authenticate / app.py
malvika2003's picture
Update app.py
2574e89 verified
raw
history blame
531 Bytes
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/predict', methods=['POST'])
def predict():
# Example of processing input
input_text = request.form['input_text']
# Perform some NLP tasks here (e.g., using transformers library)
output_text = "This is the output based on input: " + input_text
return render_template('index.html', output=output_text)
if __name__ == '__main__':
app.run(debug=True)