Spaces:
Sleeping
Sleeping
Download app.py from minhpng/test_python: direct link, hf CLI and curl.
- Browser
- Download file 797 Bytes
-
https://huggingface.co/spaces/minhpng/test_python/resolve/main/app.py
- Command line
-
hf download hf://spaces/minhpng/test_python/app.py
-
curl -L -o app.py https://huggingface.co/spaces/minhpng/test_python/resolve/main/app.py
797 Bytes
| import uvicorn | |
| import os | |
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| from routers import get_transcript, get_chatrespone, get_transcript_transformer, get_transcript_gradio | |
| os.environ['HF_HOME'] = "./cached/" | |
| app = FastAPI() | |
| app.add_middleware(CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["Content-Type", "Authorization", "x-api-key"]) | |
| app.include_router(get_transcript.router) | |
| app.include_router(get_chatrespone.router) | |
| app.include_router(get_transcript_transformer.router) | |
| app.include_router(get_transcript_gradio.router) | |
| def read_root(): | |
| return {"message": "This is from python backend cache... test here"} | |
| if __name__ == '__main__': | |
| uvicorn.run( | |
| "app:app", reload=True) | |