Spaces:
Sleeping
Sleeping
usmansafdarktk
commited on
Commit
·
f52fd48
1
Parent(s):
0bd46d0
upgraded the ordering of routes
Browse files
main.py
CHANGED
@@ -22,9 +22,6 @@ app.add_middleware(
|
|
22 |
allow_headers=["*"],
|
23 |
)
|
24 |
|
25 |
-
# Mount static files at root
|
26 |
-
app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
27 |
-
|
28 |
class TextGenerationRequest(BaseModel):
|
29 |
instruction: str
|
30 |
max_length: int = 100
|
@@ -91,6 +88,9 @@ async def generate_text(request: TextGenerationRequest):
|
|
91 |
logger.error(f"Error during text generation: {str(e)}")
|
92 |
raise HTTPException(status_code=500, detail=f"Text generation failed: {str(e)}")
|
93 |
|
|
|
|
|
|
|
94 |
if __name__ == "__main__":
|
95 |
import uvicorn
|
96 |
port = int(os.environ.get("PORT", 7860))
|
|
|
22 |
allow_headers=["*"],
|
23 |
)
|
24 |
|
|
|
|
|
|
|
25 |
class TextGenerationRequest(BaseModel):
|
26 |
instruction: str
|
27 |
max_length: int = 100
|
|
|
88 |
logger.error(f"Error during text generation: {str(e)}")
|
89 |
raise HTTPException(status_code=500, detail=f"Text generation failed: {str(e)}")
|
90 |
|
91 |
+
# Mount static files at root (this must be last)
|
92 |
+
app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
93 |
+
|
94 |
if __name__ == "__main__":
|
95 |
import uvicorn
|
96 |
port = int(os.environ.get("PORT", 7860))
|