Nafiul Huda commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -365,7 +365,8 @@ iframe_html = f"""
|
|
| 365 |
<iframe id="viewer-iframe" src="/file=viewer.html?{params}" style="position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; border: none; z-index: 1;"></iframe>
|
| 366 |
"""
|
| 367 |
|
| 368 |
-
|
|
|
|
| 369 |
history = gr.State([])
|
| 370 |
|
| 371 |
# Register workspace root as directly served static paths in Gradio
|
|
@@ -456,8 +457,11 @@ with gr.Blocks(css=CSS, head=HTML_HEAD) as demo:
|
|
| 456 |
)
|
| 457 |
|
| 458 |
if __name__ == "__main__":
|
|
|
|
| 459 |
demo.launch(
|
| 460 |
server_name="0.0.0.0",
|
| 461 |
server_port=7860,
|
|
|
|
|
|
|
| 462 |
allowed_paths=["."]
|
| 463 |
)
|
|
|
|
| 365 |
<iframe id="viewer-iframe" src="/file=viewer.html?{params}" style="position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; border: none; z-index: 1;"></iframe>
|
| 366 |
"""
|
| 367 |
|
| 368 |
+
# In Gradio 6.0+, css and head must be passed to demo.launch() instead of gr.Blocks()
|
| 369 |
+
with gr.Blocks() as demo:
|
| 370 |
history = gr.State([])
|
| 371 |
|
| 372 |
# Register workspace root as directly served static paths in Gradio
|
|
|
|
| 457 |
)
|
| 458 |
|
| 459 |
if __name__ == "__main__":
|
| 460 |
+
# Pass CSS and head parameters to launch() for Gradio 6.0+ compatibility
|
| 461 |
demo.launch(
|
| 462 |
server_name="0.0.0.0",
|
| 463 |
server_port=7860,
|
| 464 |
+
css=CSS,
|
| 465 |
+
head=HTML_HEAD,
|
| 466 |
allowed_paths=["."]
|
| 467 |
)
|