Spaces:
Sleeping
Sleeping
Jac-Zac commited on
Commit ·
bf30281
1
Parent(s): a1b8512
Updated to latest persona-vector version
Browse files- pyproject.toml +1 -1
- tabs/probe.py +3 -1
- tests/test_probe_sweep.py +9 -1
- uv.lock +10 -10
pyproject.toml
CHANGED
|
@@ -5,7 +5,7 @@ description = "Streamlit UI for persona-vectors"
|
|
| 5 |
readme = "README.md"
|
| 6 |
requires-python = ">=3.12"
|
| 7 |
dependencies = [
|
| 8 |
-
"persona-vectors>=0.8.
|
| 9 |
"datasets>=4.8.5",
|
| 10 |
"huggingface-hub>=1.14.0",
|
| 11 |
"streamlit>=1.44.0",
|
|
|
|
| 5 |
readme = "README.md"
|
| 6 |
requires-python = ">=3.12"
|
| 7 |
dependencies = [
|
| 8 |
+
"persona-vectors>=0.8.9",
|
| 9 |
"datasets>=4.8.5",
|
| 10 |
"huggingface-hub>=1.14.0",
|
| 11 |
"streamlit>=1.44.0",
|
tabs/probe.py
CHANGED
|
@@ -97,7 +97,9 @@ def _select_personas(
|
|
| 97 |
if has_slider:
|
| 98 |
default_count = max(
|
| 99 |
min_count,
|
| 100 |
-
min(
|
|
|
|
|
|
|
| 101 |
)
|
| 102 |
count = st.slider(
|
| 103 |
"Personas",
|
|
|
|
| 97 |
if has_slider:
|
| 98 |
default_count = max(
|
| 99 |
min_count,
|
| 100 |
+
min(
|
| 101 |
+
len(all_ids), st.session_state.get("probe:persona_count", len(all_ids))
|
| 102 |
+
),
|
| 103 |
)
|
| 104 |
count = st.slider(
|
| 105 |
"Personas",
|
tests/test_probe_sweep.py
CHANGED
|
@@ -49,7 +49,15 @@ def test_cached_sweep_keeps_per_attribute_samples_and_full_plus_pca(monkeypatch)
|
|
| 49 |
filtered,
|
| 50 |
)
|
| 51 |
|
| 52 |
-
def sweep(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
assert input_samples is samples
|
| 54 |
assert layers == [0, 1]
|
| 55 |
assert probe_kinds == ["logistic_regression"]
|
|
|
|
| 49 |
filtered,
|
| 50 |
)
|
| 51 |
|
| 52 |
+
def sweep(
|
| 53 |
+
input_samples,
|
| 54 |
+
labels,
|
| 55 |
+
*,
|
| 56 |
+
layers,
|
| 57 |
+
probe_kinds,
|
| 58 |
+
n_pca_components,
|
| 59 |
+
seed,
|
| 60 |
+
):
|
| 61 |
assert input_samples is samples
|
| 62 |
assert layers == [0, 1]
|
| 63 |
assert probe_kinds == ["logistic_regression"]
|
uv.lock
CHANGED
|
@@ -1608,7 +1608,7 @@ requires-dist = [
|
|
| 1608 |
{ name = "catppuccin", specifier = ">=2.5.0" },
|
| 1609 |
{ name = "datasets", specifier = ">=4.8.5" },
|
| 1610 |
{ name = "huggingface-hub", specifier = ">=1.14.0" },
|
| 1611 |
-
{ name = "persona-vectors", specifier = ">=0.8.
|
| 1612 |
{ name = "plotly", specifier = ">=6.6.0" },
|
| 1613 |
{ name = "python-dotenv", specifier = ">=1.2.2" },
|
| 1614 |
{ name = "safetensors", specifier = ">=0.7.0" },
|
|
@@ -1620,7 +1620,7 @@ dev = [{ name = "pytest", specifier = ">=9.0.3" }]
|
|
| 1620 |
|
| 1621 |
[[package]]
|
| 1622 |
name = "persona-vectors"
|
| 1623 |
-
version = "0.8.
|
| 1624 |
source = { registry = "https://pypi.org/simple" }
|
| 1625 |
dependencies = [
|
| 1626 |
{ name = "datasets" },
|
|
@@ -1639,9 +1639,9 @@ dependencies = [
|
|
| 1639 |
{ name = "transformers" },
|
| 1640 |
{ name = "umap-learn" },
|
| 1641 |
]
|
| 1642 |
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
| 1643 |
wheels = [
|
| 1644 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 1645 |
]
|
| 1646 |
|
| 1647 |
[[package]]
|
|
@@ -2672,15 +2672,15 @@ wheels = [
|
|
| 2672 |
|
| 2673 |
[[package]]
|
| 2674 |
name = "starlette"
|
| 2675 |
-
version = "1.
|
| 2676 |
source = { registry = "https://pypi.org/simple" }
|
| 2677 |
dependencies = [
|
| 2678 |
{ name = "anyio" },
|
| 2679 |
{ name = "typing-extensions", marker = "python_full_version < '3.13'" },
|
| 2680 |
]
|
| 2681 |
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
| 2682 |
wheels = [
|
| 2683 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 2684 |
]
|
| 2685 |
|
| 2686 |
[[package]]
|
|
@@ -2990,15 +2990,15 @@ wheels = [
|
|
| 2990 |
|
| 2991 |
[[package]]
|
| 2992 |
name = "uvicorn"
|
| 2993 |
-
version = "0.
|
| 2994 |
source = { registry = "https://pypi.org/simple" }
|
| 2995 |
dependencies = [
|
| 2996 |
{ name = "click" },
|
| 2997 |
{ name = "h11" },
|
| 2998 |
]
|
| 2999 |
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
| 3000 |
wheels = [
|
| 3001 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 3002 |
]
|
| 3003 |
|
| 3004 |
[[package]]
|
|
|
|
| 1608 |
{ name = "catppuccin", specifier = ">=2.5.0" },
|
| 1609 |
{ name = "datasets", specifier = ">=4.8.5" },
|
| 1610 |
{ name = "huggingface-hub", specifier = ">=1.14.0" },
|
| 1611 |
+
{ name = "persona-vectors", specifier = ">=0.8.9" },
|
| 1612 |
{ name = "plotly", specifier = ">=6.6.0" },
|
| 1613 |
{ name = "python-dotenv", specifier = ">=1.2.2" },
|
| 1614 |
{ name = "safetensors", specifier = ">=0.7.0" },
|
|
|
|
| 1620 |
|
| 1621 |
[[package]]
|
| 1622 |
name = "persona-vectors"
|
| 1623 |
+
version = "0.8.9"
|
| 1624 |
source = { registry = "https://pypi.org/simple" }
|
| 1625 |
dependencies = [
|
| 1626 |
{ name = "datasets" },
|
|
|
|
| 1639 |
{ name = "transformers" },
|
| 1640 |
{ name = "umap-learn" },
|
| 1641 |
]
|
| 1642 |
+
sdist = { url = "https://files.pythonhosted.org/packages/b8/2f/a7ac3d5c3b9bfa2150dba19b4317d5e74c1e284a4e43c55d75f8fe140444/persona_vectors-0.8.9.tar.gz", hash = "sha256:84056f4b0cfacc068d05ffff9349384f773717477e347680a2c685a312aac462", size = 43994, upload-time = "2026-05-25T11:37:33.592Z" }
|
| 1643 |
wheels = [
|
| 1644 |
+
{ url = "https://files.pythonhosted.org/packages/c9/c3/2322bd2c341fcb175db5e946e51b8a91c6b25b41b299dd7b6eaa70d50e86/persona_vectors-0.8.9-py3-none-any.whl", hash = "sha256:5abe0f97787a21c6fd747aa3cf5213214ba18e4cf92a89159e986c7547beef79", size = 53905, upload-time = "2026-05-25T11:37:34.75Z" },
|
| 1645 |
]
|
| 1646 |
|
| 1647 |
[[package]]
|
|
|
|
| 2672 |
|
| 2673 |
[[package]]
|
| 2674 |
name = "starlette"
|
| 2675 |
+
version = "1.1.0"
|
| 2676 |
source = { registry = "https://pypi.org/simple" }
|
| 2677 |
dependencies = [
|
| 2678 |
{ name = "anyio" },
|
| 2679 |
{ name = "typing-extensions", marker = "python_full_version < '3.13'" },
|
| 2680 |
]
|
| 2681 |
+
sdist = { url = "https://files.pythonhosted.org/packages/95/66/4d20cdf39a8d6a51e663b7038e3b828ff211d3891a43a713fe7e4643f3a8/starlette-1.1.0.tar.gz", hash = "sha256:e83c7fe0ddecd8719c5b840080325aec0260acec86e9832899e377b91d65e90f", size = 2660060, upload-time = "2026-05-23T16:55:41.376Z" }
|
| 2682 |
wheels = [
|
| 2683 |
+
{ url = "https://files.pythonhosted.org/packages/93/79/920b8e0a8b20f793e8d64855095cb8febabf6175b8550b6f7a547d813891/starlette-1.1.0-py3-none-any.whl", hash = "sha256:7f0dfd38e428aad5cb6f9f667f0ca1d2d8ca3f3385dccac8305f79ec98458382", size = 72899, upload-time = "2026-05-23T16:55:39.201Z" },
|
| 2684 |
]
|
| 2685 |
|
| 2686 |
[[package]]
|
|
|
|
| 2990 |
|
| 2991 |
[[package]]
|
| 2992 |
name = "uvicorn"
|
| 2993 |
+
version = "0.48.0"
|
| 2994 |
source = { registry = "https://pypi.org/simple" }
|
| 2995 |
dependencies = [
|
| 2996 |
{ name = "click" },
|
| 2997 |
{ name = "h11" },
|
| 2998 |
]
|
| 2999 |
+
sdist = { url = "https://files.pythonhosted.org/packages/e6/bf/f6544ba992ddb9a6077343a576f9844f7f8f06ab819aefd00206e9255f18/uvicorn-0.48.0.tar.gz", hash = "sha256:a5504207195d08c2511bf9125ede5ac4a4b71725d519e758d01dcf0bc2d31c37", size = 91074, upload-time = "2026-05-24T12:08:41.925Z" }
|
| 3000 |
wheels = [
|
| 3001 |
+
{ url = "https://files.pythonhosted.org/packages/01/be/72532be3da7acc5fdfbccdb95215cd04f995a0886532a5b423f929cda4cc/uvicorn-0.48.0-py3-none-any.whl", hash = "sha256:48097851328b87ec36117d3d575234519eb58c2b22d79666e9bbc6c49a761dad", size = 71410, upload-time = "2026-05-24T12:08:40.258Z" },
|
| 3002 |
]
|
| 3003 |
|
| 3004 |
[[package]]
|