Spaces:
Running
Running
Update app.py
Browse files12345678910111213141516171819202122import gradio as grimport os# index.html 읽기html_path = os.path.join(os.path.dirname(os.path.abspath(__file__)) if "__file__" in dir() else ".", "index.html")if os.path.exists(html_path):with open(html_path, "r", encoding="utf-8") as f:HTML_CONTENT = f.read()else:HTML_CONTENT = "<h1>index.html 파일을 찾을 수 없습니다.</h1>"# Gradio의 기본 UI를 완전히 숨기고 index.html만 표시CSS = """footer { display: none !important; }.gradio-container { padding: 0 !important; margin: 0 !important; max-width: 100% !important; background: transparent !important; }#component-0 { padding: 0 !important; }"""with gr.Blocks() as app:gr.HTML(HTML_CONTENT)app.launch(server_name="0.0.0.0", ssr_mode=False, css=CSS)123456789101112131415from fastapi import FastAPIfrom fastapi.responses import HTMLResponsefrom fastapi.staticfiles import StaticFilesimport osapp = FastAPI()@app.get("/", response_class=HTMLResponse)def root():with open("index.html", "r", encoding="utf-8") as f:return f.read()if __name__ == "__main__":import uvicornuvicorn.run(app, host="0.0.0.0", port=7860)
app.py+11-18