Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

app.py 607 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  1. from pathlib import Path
  2. from fastapi import FastAPI
  3. from news_cat.config import get_app_settings
  4. from news_cat.web.api import router as api_router
  5. from news_cat.web.config import get_web_config
  6. from news_cat.web.inference import get_model_loader, get_spacy_nlp
  7. app_cfg = get_app_settings()
  8. app_cfg.update_base(Path(".").resolve())
  9. # Startup. Can be done in async startup using a status flag in app_cfg
  10. _ = get_web_config()
  11. _ = get_spacy_nlp()
  12. _ = get_model_loader()
  13. app = FastAPI()
  14. app.include_router(api_router, prefix="/api/v1")
  15. if __name__ == "__main__":
  16. import uvicorn
  17. uvicorn.run(app)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...