Upload folder using huggingface_hub
Browse files- app.py +18 -2
- requirements.txt +37 -32
app.py
CHANGED
@@ -824,14 +824,30 @@ if __name__ == "__main__":
|
|
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(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
831 |
else:
|
832 |
logger.warning(
|
833 |
f"Favicon not found at {favicon_path}, launching without it."
|
834 |
)
|
835 |
-
ankigen_interface.launch(
|
|
|
|
|
|
|
|
|
|
|
|
|
836 |
except Exception as e:
|
837 |
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 |
+
# 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)
|
requirements.txt
CHANGED
@@ -1,63 +1,68 @@
|
|
1 |
-
aiofiles==
|
2 |
annotated-types==0.7.0
|
3 |
anyio==4.9.0
|
|
|
4 |
beautifulsoup4==4.12.3
|
5 |
cached-property==2.0.1
|
6 |
-
certifi==2025.
|
7 |
-
charset-normalizer==3.4.
|
8 |
chevron==0.14.0
|
9 |
-
click==8.1
|
|
|
10 |
distro==1.9.0
|
11 |
-
fastapi==0.115.
|
12 |
-
ffmpy==0.
|
13 |
filelock==3.18.0
|
14 |
frozendict==2.4.6
|
15 |
-
fsspec==2025.
|
16 |
genanki==0.13.1
|
17 |
-
gradio==5.
|
18 |
-
gradio-client
|
|
|
19 |
h11==0.16.0
|
20 |
-
|
|
|
21 |
httpx==0.28.1
|
22 |
-
huggingface-hub==0.
|
23 |
idna==3.10
|
24 |
jinja2==3.1.6
|
25 |
-
jiter==0.
|
26 |
lxml==5.2.2
|
27 |
-
markdown-it-py==3.0.0
|
28 |
-
markupsafe==
|
29 |
-
mdurl==0.1.2
|
30 |
-
numpy==2.
|
31 |
-
openai==1.
|
32 |
-
orjson==3.10.
|
33 |
-
packaging==
|
34 |
pandas==2.2.3
|
35 |
-
pillow==
|
36 |
pydantic==2.10.6
|
37 |
pydantic-core==2.27.2
|
38 |
pydub==0.25.1
|
39 |
-
pygments==2.19.
|
40 |
python-dateutil==2.9.0.post0
|
41 |
python-multipart==0.0.20
|
42 |
pytz==2025.2
|
43 |
pyyaml==6.0.2
|
|
|
44 |
requests==2.32.4
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
semantic-version==2.10.0
|
49 |
-
shellingham==1.5.4
|
50 |
six==1.17.0
|
51 |
sniffio==1.3.1
|
|
|
52 |
starlette==0.46.2
|
53 |
tenacity==9.1.2
|
54 |
-
tiktoken
|
55 |
-
tomlkit==0.
|
56 |
tqdm==4.67.1
|
57 |
-
typer==0.
|
58 |
-
typing-extensions==4.
|
59 |
-
typing-inspection==0.4.0
|
60 |
tzdata==2025.2
|
61 |
urllib3==2.5.0
|
62 |
-
uvicorn==0.34.
|
63 |
-
websockets==
|
|
|
1 |
+
aiofiles==24.1.0
|
2 |
annotated-types==0.7.0
|
3 |
anyio==4.9.0
|
4 |
+
audioop-lts==0.2.1 ; python_full_version >= '3.13'
|
5 |
beautifulsoup4==4.12.3
|
6 |
cached-property==2.0.1
|
7 |
+
certifi==2025.6.15
|
8 |
+
charset-normalizer==3.4.2
|
9 |
chevron==0.14.0
|
10 |
+
click==8.2.1 ; sys_platform != 'emscripten'
|
11 |
+
colorama==0.4.6 ; sys_platform == 'win32'
|
12 |
distro==1.9.0
|
13 |
+
fastapi==0.115.13
|
14 |
+
ffmpy==0.6.0
|
15 |
filelock==3.18.0
|
16 |
frozendict==2.4.6
|
17 |
+
fsspec==2025.5.1
|
18 |
genanki==0.13.1
|
19 |
+
gradio==5.34.2
|
20 |
+
gradio-client==1.10.3
|
21 |
+
groovy==0.1.2
|
22 |
h11==0.16.0
|
23 |
+
hf-xet==1.1.5 ; platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'
|
24 |
+
httpcore==1.0.9
|
25 |
httpx==0.28.1
|
26 |
+
huggingface-hub==0.33.1
|
27 |
idna==3.10
|
28 |
jinja2==3.1.6
|
29 |
+
jiter==0.10.0
|
30 |
lxml==5.2.2
|
31 |
+
markdown-it-py==3.0.0 ; sys_platform != 'emscripten'
|
32 |
+
markupsafe==3.0.2
|
33 |
+
mdurl==0.1.2 ; sys_platform != 'emscripten'
|
34 |
+
numpy==2.3.1
|
35 |
+
openai==1.91.0
|
36 |
+
orjson==3.10.18
|
37 |
+
packaging==25.0
|
38 |
pandas==2.2.3
|
39 |
+
pillow==11.2.1
|
40 |
pydantic==2.10.6
|
41 |
pydantic-core==2.27.2
|
42 |
pydub==0.25.1
|
43 |
+
pygments==2.19.2 ; sys_platform != 'emscripten'
|
44 |
python-dateutil==2.9.0.post0
|
45 |
python-multipart==0.0.20
|
46 |
pytz==2025.2
|
47 |
pyyaml==6.0.2
|
48 |
+
regex==2024.11.6
|
49 |
requests==2.32.4
|
50 |
+
rich==14.0.0 ; sys_platform != 'emscripten'
|
51 |
+
ruff==0.12.0 ; sys_platform != 'emscripten'
|
52 |
+
safehttpx==0.1.6
|
53 |
semantic-version==2.10.0
|
54 |
+
shellingham==1.5.4 ; sys_platform != 'emscripten'
|
55 |
six==1.17.0
|
56 |
sniffio==1.3.1
|
57 |
+
soupsieve==2.7
|
58 |
starlette==0.46.2
|
59 |
tenacity==9.1.2
|
60 |
+
tiktoken==0.9.0
|
61 |
+
tomlkit==0.13.3
|
62 |
tqdm==4.67.1
|
63 |
+
typer==0.16.0 ; sys_platform != 'emscripten'
|
64 |
+
typing-extensions==4.14.0
|
|
|
65 |
tzdata==2025.2
|
66 |
urllib3==2.5.0
|
67 |
+
uvicorn==0.34.3 ; sys_platform != 'emscripten'
|
68 |
+
websockets==15.0.1
|