Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -146,26 +146,10 @@ def stream(session_id: str) -> str:
|
|
| 146 |
time.sleep(min(ahead - 1.0, 0.5))
|
| 147 |
|
| 148 |
|
| 149 |
-
APP_MAXWIDTH = "1180px"
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
@app.get("/app")
|
| 153 |
-
async def app_page():
|
| 154 |
-
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "index.html")) as f:
|
| 155 |
-
return HTMLResponse(f.read())
|
| 156 |
-
|
| 157 |
-
|
| 158 |
@app.get("/")
|
| 159 |
async def index():
|
| 160 |
-
html
|
| 161 |
-
|
| 162 |
-
'<meta name="viewport" content="width=device-width,initial-scale=1">'
|
| 163 |
-
'<style>html,body{margin:0;height:100%;background:#161719;overflow:hidden}'
|
| 164 |
-
'iframe{display:block;border:0;margin:0 auto;height:100vh;width:100%;max-width:%s;'
|
| 165 |
-
'box-shadow:0 0 80px #0007}</style></head>'
|
| 166 |
-
'<body><iframe src="/app" allow="autoplay;microphone"></iframe></body></html>'
|
| 167 |
-
) % APP_MAXWIDTH
|
| 168 |
-
return HTMLResponse(html)
|
| 169 |
|
| 170 |
|
| 171 |
app.launch(show_error=True)
|
|
|
|
| 146 |
time.sleep(min(ahead - 1.0, 0.5))
|
| 147 |
|
| 148 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
@app.get("/")
|
| 150 |
async def index():
|
| 151 |
+
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "index.html")) as f:
|
| 152 |
+
return HTMLResponse(f.read())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
|
| 154 |
|
| 155 |
app.launch(show_error=True)
|