Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -824,30 +824,14 @@ if __name__ == "__main__":
|
|
| 824 |
try:
|
| 825 |
ankigen_interface = create_ankigen_interface()
|
| 826 |
logger.info("Launching AnkiGen Gradio interface...")
|
| 827 |
-
# Configure queue with explicit SSE settings for Gradio 5.x compatibility
|
| 828 |
-
ankigen_interface.queue(default_concurrency_limit=10, max_size=100)
|
| 829 |
-
|
| 830 |
# Ensure favicon.ico is in the same directory as app.py or provide correct path
|
| 831 |
favicon_path = Path(__file__).parent / "favicon.ico"
|
| 832 |
if favicon_path.exists():
|
| 833 |
-
ankigen_interface.launch(
|
| 834 |
-
share=False,
|
| 835 |
-
favicon_path=str(favicon_path),
|
| 836 |
-
server_name="0.0.0.0",
|
| 837 |
-
server_port=7860,
|
| 838 |
-
max_threads=40,
|
| 839 |
-
show_error=True,
|
| 840 |
-
)
|
| 841 |
else:
|
| 842 |
logger.warning(
|
| 843 |
f"Favicon not found at {favicon_path}, launching without it."
|
| 844 |
)
|
| 845 |
-
ankigen_interface.launch(
|
| 846 |
-
share=False,
|
| 847 |
-
server_name="0.0.0.0",
|
| 848 |
-
server_port=7860,
|
| 849 |
-
max_threads=40,
|
| 850 |
-
show_error=True,
|
| 851 |
-
)
|
| 852 |
except Exception as e:
|
| 853 |
logger.critical(f"Failed to launch Gradio interface: {e}", exc_info=True)
|
|
|
|
| 824 |
try:
|
| 825 |
ankigen_interface = create_ankigen_interface()
|
| 826 |
logger.info("Launching AnkiGen Gradio interface...")
|
|
|
|
|
|
|
|
|
|
| 827 |
# Ensure favicon.ico is in the same directory as app.py or provide correct path
|
| 828 |
favicon_path = Path(__file__).parent / "favicon.ico"
|
| 829 |
if favicon_path.exists():
|
| 830 |
+
ankigen_interface.launch(share=False, favicon_path=str(favicon_path))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 831 |
else:
|
| 832 |
logger.warning(
|
| 833 |
f"Favicon not found at {favicon_path}, launching without it."
|
| 834 |
)
|
| 835 |
+
ankigen_interface.launch(share=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 836 |
except Exception as e:
|
| 837 |
logger.critical(f"Failed to launch Gradio interface: {e}", exc_info=True)
|