Spaces:
Runtime error
Runtime error
File size: 750 Bytes
7b701ad f989106 7b701ad 0a7b476 f989106 21e9f5a 7b701ad 21e9f5a 7b701ad f989106 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# app.py
#from flask import Flask, render_template, request, jsonify
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi.responses import FileResponse
from transformers import pipeline
app = FastAPI()
#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)
|