AkshayaKeerthi commited on
Commit
21e9f5a
·
verified ·
1 Parent(s): a7fe28f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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': response_text})
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)