Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -38,10 +38,10 @@ app.add_middleware(
|
|
38 |
allow_headers=["*"],
|
39 |
)
|
40 |
|
41 |
-
|
42 |
def api_home():
|
43 |
return {'detail': 'Welcome to FastAPI TextGen Tutorial!'}
|
44 |
|
45 |
-
|
46 |
def inference(input_prompt: str):
|
47 |
-
return generate_text(prompt=input_prompt)
|
|
|
38 |
allow_headers=["*"],
|
39 |
)
|
40 |
|
41 |
+
@app.get("/", tags=["Home"])
|
42 |
def api_home():
|
43 |
return {'detail': 'Welcome to FastAPI TextGen Tutorial!'}
|
44 |
|
45 |
+
@app.post("/api/generate", summary="Generate text from prompt", tags=["Generate"], response_model=Generate)
|
46 |
def inference(input_prompt: str):
|
47 |
+
return generate_text(prompt=input_prompt)
|