diff --git a/README.md b/README.md index 29b19dd..d13010e 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,11 @@ See the documentation for a specific pipeline for information on additional keyw ## Transformer Pipeline Tasks +You can list available tasks with: +```sh-session +$ llm transformers list-tasks +``` + ### [audio-classification](https://huggingface.co/docs/transformers/en/main_classes/pipelines#transformers.AudioClassificationPipeline) The `audio-classification` task takes an audio URL or path, for example: diff --git a/tests/test_transformers.py b/tests/test_transformers.py index 7295011..da54565 100644 --- a/tests/test_transformers.py +++ b/tests/test_transformers.py @@ -658,3 +658,12 @@ def test_transformer(monkeypatch, capsys, llm_args, validator): def test_plugin_is_installed(): names = [mod.__name__ for mod in pm.get_plugins()] assert "llm_transformers" in names + + +def test_list_tasks(monkeypatch, capsys): + monkeypatch.setattr(sys, "argv", ["llm", "transformers", "list-tasks"]) + monkeypatch.setattr(sys.stdin, "isatty", lambda: True) # prevent llm from trying to read from stdin + monkeypatch.setattr(sys, "exit", lambda x=None: None) + cli() + captured = capsys.readouterr() + assert "text-generation" in captured.out