Spaces:
Running
Running
refactor: update display endpoint to redirect to GitHub repository
Browse files
main.py
CHANGED
|
@@ -6,6 +6,7 @@ import tensorflow as tf
|
|
| 6 |
from pathlib import Path
|
| 7 |
from pydantic import BaseModel
|
| 8 |
from fastapi import FastAPI, UploadFile
|
|
|
|
| 9 |
from database import update_data_field, cleanup
|
| 10 |
|
| 11 |
|
|
@@ -34,7 +35,8 @@ def load_model():
|
|
| 34 |
|
| 35 |
@app.get("/")
|
| 36 |
def display() -> str:
|
| 37 |
-
|
|
|
|
| 38 |
|
| 39 |
@app.post("/predict")
|
| 40 |
def predict(file: UploadFile) -> str:
|
|
|
|
| 6 |
from pathlib import Path
|
| 7 |
from pydantic import BaseModel
|
| 8 |
from fastapi import FastAPI, UploadFile
|
| 9 |
+
from starlette.responses import RedirectResponse
|
| 10 |
from database import update_data_field, cleanup
|
| 11 |
|
| 12 |
|
|
|
|
| 35 |
|
| 36 |
@app.get("/")
|
| 37 |
def display() -> str:
|
| 38 |
+
response = RedirectResponse(url='https://github.com/epicshi')
|
| 39 |
+
return response
|
| 40 |
|
| 41 |
@app.post("/predict")
|
| 42 |
def predict(file: UploadFile) -> str:
|