Spaces:
Runtime error
Runtime error
CaesarCloudSync
commited on
Commit
·
755c600
1
Parent(s):
8a6d310
Add application file main docker
Browse files- RequestModels.py +3 -0
- main.py +13 -1
RequestModels.py
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
main.py
CHANGED
@@ -1,6 +1,12 @@
|
|
1 |
from fastapi import FastAPI
|
2 |
from fastapi.staticfiles import StaticFiles
|
3 |
from fastapi.responses import FileResponse
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
from transformers import pipeline
|
6 |
|
@@ -17,4 +23,10 @@ def t5(input):
|
|
17 |
|
18 |
@app.get("/")
|
19 |
def index(): #-> FileResponse:
|
20 |
-
return {"hello":"world"}#FileResponse(path="/app/static/index.html", media_type="text/html")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from fastapi import FastAPI
|
2 |
from fastapi.staticfiles import StaticFiles
|
3 |
from fastapi.responses import FileResponse
|
4 |
+
from typing import Union
|
5 |
+
|
6 |
+
from fastapi import FastAPI
|
7 |
+
from pydantic import BaseModel
|
8 |
+
|
9 |
+
|
10 |
|
11 |
from transformers import pipeline
|
12 |
|
|
|
23 |
|
24 |
@app.get("/")
|
25 |
def index(): #-> FileResponse:
|
26 |
+
return {"hello":"world"}#FileResponse(path="/app/static/index.html", media_type="text/html")
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
+
@app.post("/items/")
|
31 |
+
async def create_item(item):
|
32 |
+
return item
|