z0u commited on
Commit
b479caf
·
unverified ·
1 Parent(s): edfead8

fixed deployment for HF: using requirements.txt only, not pyproject.toml

Browse files
Files changed (6) hide show
  1. README.md +6 -2
  2. app.py +4 -0
  3. pyproject.toml +0 -32
  4. requirements-dev.txt +5 -0
  5. requirements.txt +3 -2
  6. uv.lock +0 -0
README.md CHANGED
@@ -43,8 +43,12 @@ Try these examples to see different aspects of the visualization:
43
  To run locally:
44
 
45
  ```bash
46
- pip install -e ".[space]" # Install with Gradio UI dependencies
47
- python app.py
 
 
 
 
48
  ```
49
 
50
 
 
43
  To run locally:
44
 
45
  ```bash
46
+ uv venv
47
+ # source .venv/bin/activate
48
+ uv pip install -r requirements-dev.txt
49
+ uv pip compile requirements-dev.txt -o uv.lock
50
+
51
+ uv run app.py
52
  ```
53
 
54
 
app.py CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  import gradio as gr
2
  from sparky.inference import load_model, calc_token_metrics, visualize_batch
3
 
 
1
+ import sys
2
+ from pathlib import Path
3
+ sys.path.append(str(Path(__file__).parent / "src"))
4
+
5
  import gradio as gr
6
  from sparky.inference import load_model, calc_token_metrics, visualize_batch
7
 
pyproject.toml DELETED
@@ -1,32 +0,0 @@
1
- [project]
2
- name = "sparky"
3
- version = "0.1.0"
4
- description = "Add your description here"
5
- readme = "README.md"
6
- requires-python = ">=3.12"
7
- dependencies = [
8
- "numpy>=2.2.2",
9
- ]
10
-
11
- [dependency-groups]
12
- dev = [
13
- "pytest>=8.3.4",
14
- "ruff>=0.9.3",
15
- ]
16
-
17
- [project.optional-dependencies]
18
- # Core inference dependencies
19
- inference = [
20
- "torch>=2.5.1",
21
- "transformers>=4.48.1",
22
- ]
23
- # Everything needed for the Hugging Face Space
24
- space = [
25
- "torch>=2.5.1",
26
- "transformers>=4.48.1",
27
- "gradio==5.13.2",
28
- ]
29
-
30
- [build-system]
31
- requires = ["hatchling"]
32
- build-backend = "hatchling.build"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
requirements-dev.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ -r requirements.txt
2
+ pytest~=8.3.4
3
+ ruff~=0.9.3
4
+ # This is a hard dependency, but it's provided by HF.
5
+ gradio~=5.13.2
requirements.txt CHANGED
@@ -1,2 +1,3 @@
1
- # For Hugging Face Spaces: install from pyproject.toml with additional requirements for running as an app.
2
- -e .[space]
 
 
1
+ numpy~=2.2.2
2
+ torch~=2.5.1
3
+ transformers~=4.48.1
uv.lock CHANGED
The diff for this file is too large to render. See raw diff