Skip to content

Commit 7f6127e

Browse files
authored
Support prompt engineered annotators backed by dynamic SUTs (#62)
* Update dependencies. * Avoid concurrency. * Rename run to cli and write default config. * Update lister with compact_uid_list syntax.
1 parent 9901ba4 commit 7f6127e

File tree

7 files changed

+117
-142
lines changed

7 files changed

+117
-142
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@ jobs:
3838
run: |
3939
poetry env remove python || true
4040
41+
# TODO: get rid of the POETRY_INSTALLER_MAX_WORKERS env var once we get rid of plugins
4142
- name: Install dependencies
4243
run: |
4344
poetry cache clear --no-interaction --all .
44-
poetry install --with test --no-cache
45+
POETRY_INSTALLER_MAX_WORKERS=1 poetry install --with test --no-cache
4546
4647
- name: Run all tests
4748
run: MLFLOW_TRACKING_URI=http://localhost:8080 poetry run pytest

poetry.lock

Lines changed: 95 additions & 121 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ packages = [
1313
python = ">=3.10,!=3.12.5,<3.13"
1414
click = "^8"
1515
dvc = {extras = ["gs"], version = "^3.60"}
16-
modelbench = {git = "https://github.com/mlcommons/modelbench.git", rev = "afe1cbfa42eebe3363440d1ab5841c007384e244" }
16+
modelbench = {git = "https://github.com/mlcommons/modelbench.git", rev = "ba582ed35a58cf6219786624c83e6915a9bcf98a" }
1717
mlflow = "^3.1.1"
1818
python-dotenv = "^1"
1919
requests = "^2"
@@ -25,19 +25,17 @@ jupyter = "^1"
2525
scikit-learn = "^1.5.0"
2626
pandas = "^2.2.2"
2727
# plugins (would like to figure out a better way to manage these)
28-
modelgauge_anthropic = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/anthropic", rev = "afe1cbfa42eebe3363440d1ab5841c007384e244" }
29-
modelgauge-azure = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/azure", rev = "afe1cbfa42eebe3363440d1ab5841c007384e244" }
30-
modelgauge_baseten = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/baseten", rev = "afe1cbfa42eebe3363440d1ab5841c007384e244" }
31-
modelgauge_demo_plugin = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "demo_plugin", rev = "afe1cbfa42eebe3363440d1ab5841c007384e244" }
32-
modelgauge_nvidia = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/nvidia", rev = "afe1cbfa42eebe3363440d1ab5841c007384e244" }
33-
modelgauge_openai = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/openai", rev = "afe1cbfa42eebe3363440d1ab5841c007384e244" }
34-
modelgauge_huggingface = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/huggingface", rev = "afe1cbfa42eebe3363440d1ab5841c007384e244" }
35-
modelgauge_perspective_api = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/perspective_api", rev = "afe1cbfa42eebe3363440d1ab5841c007384e244" }
36-
modelgauge_google = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/google", rev = "afe1cbfa42eebe3363440d1ab5841c007384e244" }
37-
modelgauge_vertexai = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/vertexai", rev = "afe1cbfa42eebe3363440d1ab5841c007384e244" }
38-
modelgauge_mistral = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/mistral", rev = "afe1cbfa42eebe3363440d1ab5841c007384e244" }
39-
modelgauge_amazon = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/amazon", rev = "afe1cbfa42eebe3363440d1ab5841c007384e244" }
40-
modelbench-private = { git = "[email protected]:mlcommons/modelbench-private.git", rev = "982973bd51e6c7ebb1bebaaa1eeb6a297d871bb3", optional = true }
28+
modelgauge_anthropic = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/anthropic", rev = "ba582ed35a58cf6219786624c83e6915a9bcf98a" }
29+
modelgauge-azure = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/azure", rev = "ba582ed35a58cf6219786624c83e6915a9bcf98a" }
30+
modelgauge_baseten = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/baseten", rev = "ba582ed35a58cf6219786624c83e6915a9bcf98a" }
31+
modelgauge_demo_plugin = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "demo_plugin", rev = "ba582ed35a58cf6219786624c83e6915a9bcf98a" }
32+
modelgauge_nvidia = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/nvidia", rev = "ba582ed35a58cf6219786624c83e6915a9bcf98a" }
33+
modelgauge_perspective_api = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/perspective_api", rev = "ba582ed35a58cf6219786624c83e6915a9bcf98a" }
34+
modelgauge_google = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/google", rev = "ba582ed35a58cf6219786624c83e6915a9bcf98a" }
35+
modelgauge_vertexai = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/vertexai", rev = "ba582ed35a58cf6219786624c83e6915a9bcf98a" }
36+
modelgauge_mistral = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/mistral", rev = "ba582ed35a58cf6219786624c83e6915a9bcf98a" }
37+
modelgauge_amazon = { git = "https://github.com/mlcommons/modelbench.git", subdirectory = "plugins/amazon", rev = "ba582ed35a58cf6219786624c83e6915a9bcf98a" }
38+
modelbench-private = { git = "[email protected]:mlcommons/modelbench-private.git", rev = "ecac4cfd343411c8011c0bba875d638fc22e9478", optional = true }
4139

4240
[tool.poetry.extras]
4341
modelbench-private = ["modelbench-private"]
@@ -50,7 +48,7 @@ pytest = "^8"
5048
pytest-cov = "^6"
5149

5250
[tool.poetry.scripts]
53-
modelplane = "modelplane.runways.run:cli"
51+
modelplane = "modelplane.cli:cli"
5452

5553
[build-system]
5654
requires = ["poetry-core"]

src/modelplane/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from modelgauge.config import write_default_config
2+
3+
write_default_config()

src/modelplane/runways/lister.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
from modelgauge.annotator_registry import ANNOTATORS
2-
from modelgauge.command_line import compact_sut_list
32
from modelgauge.ensemble_annotator_set import ENSEMBLE_STRATEGIES
43
from modelgauge.sut_registry import SUTS
54

65

76
def list_annotators():
8-
print(compact_sut_list(ANNOTATORS))
7+
print(ANNOTATORS.compact_uid_list())
98

109

1110
def list_suts():
12-
print(compact_sut_list(SUTS))
11+
print(SUTS.compact_uid_list())
1312

1413

1514
def list_ensemble_strategies():
16-
print(compact_sut_list(ENSEMBLE_STRATEGIES))
15+
print(sorted(ENSEMBLE_STRATEGIES))

tests/it/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pytest
22
from click.testing import CliRunner
33

4-
from modelplane.runways.run import cli
4+
from modelplane.cli import cli
55

66

77
def test_main_help():

0 commit comments

Comments
 (0)