Spaces:
Runtime error
Runtime error
AkshayaKeerthi
commited on
Commit
•
f989106
1
Parent(s):
9755f88
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,13 @@
|
|
1 |
# app.py
|
2 |
-
from flask import Flask, render_template, request, jsonify
|
|
|
|
|
|
|
|
|
|
|
3 |
from transformers import pipeline
|
4 |
|
5 |
-
app =
|
6 |
#model = pipeline('question-answering', model='bert-large-uncased-whole-word-masking-finetuned-squad', revision='main')
|
7 |
|
8 |
@app.route('/')
|
@@ -16,5 +21,5 @@ def predict():
|
|
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)
|
|
|
1 |
# app.py
|
2 |
+
#from flask import Flask, render_template, request, jsonify
|
3 |
+
|
4 |
+
from fastapi import FastAPI
|
5 |
+
from fastapi.staticfiles import StaticFiles
|
6 |
+
from fastapi.responses import FileResponse
|
7 |
+
|
8 |
from transformers import pipeline
|
9 |
|
10 |
+
app = FastAPI()
|
11 |
#model = pipeline('question-answering', model='bert-large-uncased-whole-word-masking-finetuned-squad', revision='main')
|
12 |
|
13 |
@app.route('/')
|
|
|
21 |
#response_text = result[0]['generated_text']
|
22 |
return jsonify({'response': "Hello, Hugging Face!"})#response_text
|
23 |
|
24 |
+
#if __name__ == '__main__':
|
25 |
+
# app.run(host='0.0.0.0', port=5000)
|