diff --git a/apis.py b/apis.py index d35ca0a..3c09dea 100644 --- a/apis.py +++ b/apis.py @@ -30,10 +30,12 @@ def extractConfig(nameModel="SystemData",relPath=os.path.join(pwd,"conf/experime Output= config[dataOut] return Output mode_list=extractConfig(nameModel="SystemData",dataOut="mode_list") - +from fastapi.templating import Jinja2Templates +from fastapi.staticfiles import StaticFiles app = FastAPI() #app.mount("/statics", StaticFiles(directory="statics"), name="statics") +templates = Jinja2Templates(directory="templates") app.add_middleware( CORSMiddleware, allow_origins=["*"], @@ -84,7 +86,13 @@ class Response5(BaseModel): prompt: str = Query("", description="Style and sentiments of text") mode : str = Query("", description="Style and sentiments of text") +menuaudtext=""" + """ +menuLLM=""" + + +""" #Funcionales @app.post("/uploadimg") @@ -146,114 +154,12 @@ def upload_audio(audio: UploadFile = File(...)): audio.file.close() @app.get("/addaudiohtml") -def addaudiohtml(): - html=""" - - - Audio Upload - - -

Upload Audio File

-
- -
- -
- - - - - - """ - return HTMLResponse(content=html, status_code=200) - +def addaudiohtml(request: Request): + return templates.TemplateResponse("addaudio.html", {"request": request}) + @app.get("/addimagehtml") -def addimagehtml(): - html=""" - - - image Upload - - -

Upload image File

-
- - -
- - - - - - """ - return HTMLResponse(content=html, status_code=200) +def addimagehtml(request: Request): + return templates.TemplateResponse("addimage.html", {"request": request}) @@ -403,7 +309,7 @@ def EvalVoicehtml(): - Evaluacion de modelos voice2txt + Evaluación de modelos voice2txt + + +

{{title}}

+ + + +
+ +
+ +
+ + + + \ No newline at end of file diff --git a/templates/addaudio.html b/templates/addaudio.html new file mode 100644 index 0000000..e992f8c --- /dev/null +++ b/templates/addaudio.html @@ -0,0 +1,49 @@ + + + + Audio Upload + + +

Upload Audio File

+
+ +
+ +
+ + + + \ No newline at end of file diff --git a/templates/addimage.html b/templates/addimage.html new file mode 100644 index 0000000..1bd1f00 --- /dev/null +++ b/templates/addimage.html @@ -0,0 +1,49 @@ + + + + image Upload + + +

Upload image File

+
+ + +
+ + + + \ No newline at end of file diff --git a/html/getmetricsvoice.html b/templates/getmetricsvoice.html similarity index 100% rename from html/getmetricsvoice.html rename to templates/getmetricsvoice.html diff --git a/html/index.html b/templates/index.html similarity index 100% rename from html/index.html rename to templates/index.html