Skip to content

Commit

Permalink
Merge pull request #406 from explosion/main
Browse files Browse the repository at this point in the history
Sync `develop` with `main`
  • Loading branch information
rmitsch authored Dec 28, 2023
2 parents bf4a286 + 0cb81d2 commit 07c5c8f
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions spacy_llm/tests/tasks/test_custom.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
from typing import Iterable

from confection import Config
from spacy.tokens import Doc

from spacy_llm.registry import registry
from spacy_llm.util import assemble
from spacy_llm.util import assemble_from_config

config = """[nlp]
lang = "en"
pipeline = ["llm"]
[components]
[components.llm]
factory = "llm"
save_io = True
[components.llm.task]
@llm_tasks = "my_namespace.MyTask.v1"
[components.llm.model]
@llm_models = "spacy.NoOp.v1"
"""


@registry.llm_tasks("my_namespace.MyTask.v1")
Expand All @@ -26,5 +44,5 @@ def parse_responses(


def test_custom_task():
nlp = assemble("custom.cfg")
nlp = assemble_from_config(Config().from_str(config))
nlp("This is a test.")

0 comments on commit 07c5c8f

Please sign in to comment.