diff --git a/.gitignore b/.gitignore index 266478df..4bb1a18e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ tests/data/embeddings src/.data .vscode *.gz -*.pt \ No newline at end of file +*.pt +/src/interface/web/*.jpg +/src/interface/web/*.png \ No newline at end of file diff --git a/src/interface/web/index.html b/src/interface/web/index.html new file mode 100644 index 00000000..611c1f55 --- /dev/null +++ b/src/interface/web/index.html @@ -0,0 +1,78 @@ + + + +
+ + + + + + + + + + + + + + + diff --git a/src/main.py b/src/main.py index 68d0c401..34e73c4d 100644 --- a/src/main.py +++ b/src/main.py @@ -1,12 +1,12 @@ # Standard Packages -import sys, json, yaml +import sys, json, yaml, os from typing import Optional # External Packages import uvicorn import torch from fastapi import FastAPI, Request -from fastapi.responses import HTMLResponse +from fastapi.responses import HTMLResponse, FileResponse from fastapi.staticfiles import StaticFiles from fastapi.templating import Jinja2Templates @@ -27,10 +27,16 @@ processor_config = ProcessorConfigModel() config_file = "" verbose = 0 app = FastAPI() +web_directory = f'src/interface/web/' +app.mount("/static", StaticFiles(directory=web_directory), name="static") app.mount("/views", StaticFiles(directory="views"), name="views") templates = Jinja2Templates(directory="views/") +@app.get("/", response_class=FileResponse) +def index(): + return FileResponse(web_directory + "index.html") + @app.get('/ui', response_class=HTMLResponse) def ui(request: Request): return templates.TemplateResponse("config.html", context={'request': request})