lamhieu commited on
Commit
80eaaf7
·
1 Parent(s): 37c20ce

deps: bump to Gradio 5 + FastAPI 0.115 stack (mirror lightweight-embeddings)

Browse files
Files changed (5) hide show
  1. README.md +0 -1
  2. app.py +1 -1
  3. docsifer/main.py +1 -5
  4. pyproject.toml +14 -14
  5. requirements.txt +15 -16
README.md CHANGED
@@ -97,7 +97,6 @@ All settings are environment-driven (prefix `DOCSIFER_`). See [`.env.example`](.
97
  | `DOCSIFER_REQUEST_TIMEOUT_SEC` | `55` | Conversion timeout |
98
  | `DOCSIFER_REDIS_URL` / `_TOKEN` | local | Upstash Redis for analytics |
99
  | `DOCSIFER_URL_ALLOW_PRIVATE_NETWORKS` | `false` | Disable to block SSRF |
100
- | `WEB_CONCURRENCY` *(Docker)* | `2` | Number of Gunicorn workers |
101
 
102
  ## Architecture
103
 
 
97
  | `DOCSIFER_REQUEST_TIMEOUT_SEC` | `55` | Conversion timeout |
98
  | `DOCSIFER_REDIS_URL` / `_TOKEN` | local | Upstash Redis for analytics |
99
  | `DOCSIFER_URL_ALLOW_PRIVATE_NETWORKS` | `false` | Disable to block SSRF |
 
100
 
101
  ## Architecture
102
 
app.py CHANGED
@@ -1,4 +1,4 @@
1
- """ASGI entry point for Hugging Face Spaces / uvicorn / gunicorn."""
2
 
3
  from docsifer.main import app
4
 
 
1
+ """ASGI entry point for Hugging Face Spaces / uvicorn."""
2
 
3
  from docsifer.main import app
4
 
docsifer/main.py CHANGED
@@ -6,11 +6,7 @@ and the optional Gradio UI mount.
6
 
7
  Run with::
8
 
9
- uvicorn docsifer.main:app --host 0.0.0.0 --port 7860
10
-
11
- or in production with::
12
-
13
- gunicorn -k uvicorn.workers.UvicornWorker -w 4 docsifer.main:app
14
  """
15
 
16
  from __future__ import annotations
 
6
 
7
  Run with::
8
 
9
+ uvicorn docsifer.main:app --host 0.0.0.0 --port 7860 --proxy-headers
 
 
 
 
10
  """
11
 
12
  from __future__ import annotations
pyproject.toml CHANGED
@@ -15,14 +15,15 @@ packages = [{ include = "docsifer" }]
15
 
16
  [tool.poetry.dependencies]
17
  python = "^3.10"
18
- fastapi = ">=0.110,<1.0"
19
- uvicorn = { version = ">=0.27,<1.0", extras = ["standard"] }
20
- gunicorn = ">=21.2,<23.0"
21
- pydantic = ">=2.6,<3.0"
22
- pydantic-settings = ">=2.2,<3.0"
 
23
  orjson = ">=3.10,<4.0"
24
  python-multipart = ">=0.0.9"
25
- httpx = ">=0.27,<1.0"
26
  openai = ">=1.40,<2.0"
27
  tiktoken = ">=0.7,<1.0"
28
  markitdown = "0.0.1a3"
@@ -30,17 +31,16 @@ selectolax = ">=0.3.21"
30
  python-magic = "0.4.27"
31
  upstash-redis = ">=1.2,<2.0"
32
  cachetools = ">=5.3,<6.0"
33
- psutil = ">=5.9,<7.0"
34
- gradio = { version = ">=4.40,<5.0", optional = true }
35
- pandas = { version = ">=2.0,<3.0", optional = true }
36
- # Gradio 4.x still imports ``HfFolder`` from ``huggingface_hub`` (removed in
37
- # huggingface_hub 1.0). Keep the resolver on the 0.x line until we move to
38
- # Gradio 5.x.
39
- huggingface-hub = { version = ">=0.23,<1.0", optional = true }
40
  requests = ">=2.31,<3.0"
 
 
 
 
41
 
42
  [tool.poetry.extras]
43
- ui = ["gradio", "pandas", "huggingface-hub"]
44
 
45
  [tool.poetry.group.dev.dependencies]
46
  pytest = ">=8.0,<9.0"
 
15
 
16
  [tool.poetry.dependencies]
17
  python = "^3.10"
18
+ # Runtime stack aligned with ``lightweight-embeddings`` for clean Gradio /
19
+ # FastAPI / Starlette / Pydantic / Jinja2 interop on Hugging Face Spaces.
20
+ fastapi = ">=0.115,<0.120"
21
+ uvicorn = { version = ">=0.30,<0.40", extras = ["standard"] }
22
+ pydantic = ">=2.7,<3.0"
23
+ pydantic-settings = ">=2.4,<3.0"
24
  orjson = ">=3.10,<4.0"
25
  python-multipart = ">=0.0.9"
26
+ httpx = { version = ">=0.27,<0.30", extras = ["http2"] }
27
  openai = ">=1.40,<2.0"
28
  tiktoken = ">=0.7,<1.0"
29
  markitdown = "0.0.1a3"
 
31
  python-magic = "0.4.27"
32
  upstash-redis = ">=1.2,<2.0"
33
  cachetools = ">=5.3,<6.0"
34
+ psutil = ">=5.9,<8.0"
35
+ Pillow = ">=10.3,<12.0"
 
 
 
 
 
36
  requests = ">=2.31,<3.0"
37
+ # Gradio 5.x is required for compatibility with modern Starlette templating;
38
+ # Gradio 4.x calls ``TemplateResponse`` with a deprecated signature.
39
+ gradio = { version = ">=5.0,<6.0", optional = true }
40
+ pandas = { version = ">=2.0,<3.0", optional = true }
41
 
42
  [tool.poetry.extras]
43
+ ui = ["gradio", "pandas"]
44
 
45
  [tool.poetry.group.dev.dependencies]
46
  pytest = ">=8.0,<9.0"
requirements.txt CHANGED
@@ -1,16 +1,15 @@
1
  # Production runtime requirements (Hugging Face Spaces / Docker).
2
- # Keep in sync with [tool.poetry.dependencies] in pyproject.toml. For local
3
- # development we recommend ``poetry install``; this file exists for build
4
- # pipelines that don't speak Poetry.
5
 
6
- fastapi>=0.110,<1.0
7
- uvicorn[standard]>=0.27,<1.0
8
- gunicorn>=21.2,<23.0
9
- pydantic>=2.6,<3.0
10
- pydantic-settings>=2.2,<3.0
11
  orjson>=3.10,<4.0
12
  python-multipart>=0.0.9
13
- httpx>=0.27,<1.0
14
  openai>=1.40,<2.0
15
  tiktoken>=0.7,<1.0
16
  markitdown==0.0.1a3
@@ -18,13 +17,13 @@ selectolax>=0.3.21
18
  python-magic==0.4.27
19
  upstash-redis>=1.2,<2.0
20
  cachetools>=5.3,<6.0
21
- psutil>=5.9,<7.0
 
22
  requests>=2.31,<3.0
23
 
24
- # Optional UI extras
25
- gradio>=4.40,<5.0
 
 
 
26
  pandas>=2.0,<3.0
27
- # Gradio 4.x imports ``HfFolder`` from ``huggingface_hub`` (gradio/oauth.py),
28
- # which was removed in huggingface_hub 1.0. Pin to the last 0.x line until we
29
- # move to Gradio 5.x.
30
- huggingface_hub>=0.23,<1.0
 
1
  # Production runtime requirements (Hugging Face Spaces / Docker).
2
+ # Version ranges aligned with the dependency tree used by ``lightweight-embeddings``
3
+ # so Gradio, FastAPI, Starlette, Pydantic and Jinja2 all interop cleanly on
4
+ # Spaces. Keep in sync with ``[tool.poetry.dependencies]`` in pyproject.toml.
5
 
6
+ fastapi>=0.115,<0.120
7
+ uvicorn[standard]>=0.30,<0.40
8
+ pydantic>=2.7,<3.0
9
+ pydantic-settings>=2.4,<3.0
 
10
  orjson>=3.10,<4.0
11
  python-multipart>=0.0.9
12
+ httpx[http2]>=0.27,<0.30
13
  openai>=1.40,<2.0
14
  tiktoken>=0.7,<1.0
15
  markitdown==0.0.1a3
 
17
  python-magic==0.4.27
18
  upstash-redis>=1.2,<2.0
19
  cachetools>=5.3,<6.0
20
+ psutil>=5.9,<8.0
21
+ Pillow>=10.3,<12.0
22
  requests>=2.31,<3.0
23
 
24
+ # Optional UI extras.
25
+ # Gradio 5.x is required for compatibility with modern Starlette templating;
26
+ # Gradio 4.x calls ``TemplateResponse`` with a deprecated signature that raises
27
+ # ``TypeError: unhashable type: 'dict'`` in Jinja2 on recent Starlette releases.
28
+ gradio>=5.0,<6.0
29
  pandas>=2.0,<3.0