from fastapi import FastAPI, Request, Form, UploadFile, File from fastapi.responses import HTMLResponse, RedirectResponse from fastapi.staticfiles import StaticFiles from fastapi.templating import Jinja2Templates from typing import Annotated import gradio as gr from src.grutils import answer_query, css app = FastAPI() app.mount("/static", StaticFiles(directory="static"), name="static") templates = Jinja2Templates(directory="templates") @app.get("/") async def root(): return {"message": "Hello to the world of Mohammed Vasim"} ####### Gradio app ############## chatbot = gr.Chatbot(label="Llama 2") with gr.Blocks( title="Llama 2", theme=gr.themes.Soft(), css=css ) as llama2bot: gr.Markdown("#