OnlineRAG / app.py
AkshayaKeerthi's picture
Update app.py
21e9f5a verified
raw
history blame
636 Bytes
# app.py
from flask import Flask, render_template, request, jsonify
from transformers import pipeline
app = Flask(__name__)
#model = pipeline('question-answering', model='bert-large-uncased-whole-word-masking-finetuned-squad', revision='main')
@app.route('/')
def home():
return render_template('index.html')
@app.route('/predict', methods=['POST'])
def predict():
user_input = request.json.get('message')
#result = model(user_input)
#response_text = result[0]['generated_text']
return jsonify({'response': "Hello, Hugging Face!"})#response_text
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)