Spaces:
Sleeping
Sleeping
AndriiPets
commited on
Commit
•
b2ea0e8
1
Parent(s):
8142ceb
switched to fastapi
Browse files
main.py
CHANGED
@@ -5,7 +5,7 @@ from generator import generation_function
|
|
5 |
from pydantic import BaseModel
|
6 |
|
7 |
|
8 |
-
app = FastAPI()
|
9 |
app.add_middleware(
|
10 |
CORSMiddleware,
|
11 |
allow_origins=['*'],
|
@@ -20,11 +20,6 @@ class Prompt(BaseModel):
|
|
20 |
lang: str
|
21 |
|
22 |
|
23 |
-
@app.get("/")
|
24 |
-
def hello():
|
25 |
-
return {"massage": "we are running!"}
|
26 |
-
|
27 |
-
|
28 |
@app.get("/test")
|
29 |
def test(input: str):
|
30 |
output = input
|
|
|
5 |
from pydantic import BaseModel
|
6 |
|
7 |
|
8 |
+
app = FastAPI(docs_url="/")
|
9 |
app.add_middleware(
|
10 |
CORSMiddleware,
|
11 |
allow_origins=['*'],
|
|
|
20 |
lang: str
|
21 |
|
22 |
|
|
|
|
|
|
|
|
|
|
|
23 |
@app.get("/test")
|
24 |
def test(input: str):
|
25 |
output = input
|