Spaces:
Runtime error
Runtime error
AkshayaKeerthi
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ from flask import Flask, render_template, request, jsonify
|
|
3 |
from transformers import pipeline
|
4 |
|
5 |
app = Flask(__name__)
|
6 |
-
model = pipeline('question-answering', model='bert-large-uncased-whole-word-masking-finetuned-squad', revision='main')
|
7 |
|
8 |
@app.route('/')
|
9 |
def home():
|
@@ -12,9 +12,9 @@ def home():
|
|
12 |
@app.route('/predict', methods=['POST'])
|
13 |
def predict():
|
14 |
user_input = request.json.get('message')
|
15 |
-
result = model(user_input)
|
16 |
-
response_text = result[0]['generated_text']
|
17 |
-
return jsonify({'response':
|
18 |
|
19 |
if __name__ == '__main__':
|
20 |
app.run(host='0.0.0.0', port=5000)
|
|
|
3 |
from transformers import pipeline
|
4 |
|
5 |
app = Flask(__name__)
|
6 |
+
#model = pipeline('question-answering', model='bert-large-uncased-whole-word-masking-finetuned-squad', revision='main')
|
7 |
|
8 |
@app.route('/')
|
9 |
def home():
|
|
|
12 |
@app.route('/predict', methods=['POST'])
|
13 |
def predict():
|
14 |
user_input = request.json.get('message')
|
15 |
+
#result = model(user_input)
|
16 |
+
#response_text = result[0]['generated_text']
|
17 |
+
return jsonify({'response': "Hello, Hugging Face!"})#response_text
|
18 |
|
19 |
if __name__ == '__main__':
|
20 |
app.run(host='0.0.0.0', port=5000)
|