Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I got errors with spacy-llm==0.5.1 #304

Closed
innocent-charles opened this issue Sep 23, 2023 Discussed in #303 · 5 comments
Closed

I got errors with spacy-llm==0.5.1 #304

innocent-charles opened this issue Sep 23, 2023 Discussed in #303 · 5 comments
Labels
bug Something isn't working

Comments

@innocent-charles
Copy link

Discussed in #303

Originally posted by innocent-charles September 23, 2023
I have upgraded the spacy-llm version to 0.5.1 and used the task of spacy.NER.v3 and model of spacy.GPT-3-5.v2.

But unfortunately I got the following error , what to do ?

File "pydantic/main.py", line 342, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for NERCoTExample
spans
  field required (type=value_error.missing)```</div>
@rmitsch
Copy link
Collaborator

rmitsch commented Sep 25, 2023

Hi @innocent-charles, please provide

  • your config,
  • the full stack trace and
  • a minimal reproducible example.

Thank you!

@rmitsch rmitsch added the bug Something isn't working label Sep 25, 2023
@innocent-charles
Copy link
Author

Thank you ! ,

Here's my
config :

[nlp]
lang = "en"
pipeline = ["llm"]

[components]

[components.llm]
factory = "llm"

[components.llm.task]
@llm_tasks = "spacy.NER.v3"
labels =First Name,Middle Name,Surname

[components.llm.cache]
@llm_misc = "spacy.BatchCache.v1"
path = "cache/"
batch_size = 512
max_batches_in_mem = 300

[components.llm.task.examples]
@misc = "spacy.FewShotReader.v1"
path = "Examples.yaml"

[components.llm.model]
@llm_models = "spacy.GPT-3-5.v2"
name = "gpt-3.5-turbo-16k"
config = {"temperature": 0.3}
max_tries = 10
  • I have just updated the spacy-llm from 0.4.0 to 0.5.1 and changed the config to spacy.NER.v3 and spacy.GPT-3-5.v2. Then unfortunely I end up getting this below error .

The error I got is :

  File "/home/innocent/.local/lib/python3.11/site-packages/confection/__init__.py", line 756, in resolve
    resolved, _ = cls._make(
                  ^^^^^^^^^^
  File "/home/innocent/.local/lib/python3.11/site-packages/confection/__init__.py", line 805, in _make
    filled, _, resolved = cls._fill(
                          ^^^^^^^^^^
  File "/home/innocent/.local/lib/python3.11/site-packages/confection/__init__.py", line 860, in _fill
    filled[key], validation[v_key], final[key] = cls._fill(
                                                 ^^^^^^^^^^
  File "/home/innocent/.local/lib/python3.11/site-packages/confection/__init__.py", line 877, in _fill
    getter_result = getter(*args, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/innocent/.local/lib/python3.11/site-packages/spacy_llm/tasks/ner/registry.py", line 162, in make_ner_task_v3
    [example_type(**eg) for eg in raw_examples] if raw_examples else None
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/innocent/.local/lib/python3.11/site-packages/spacy_llm/tasks/ner/registry.py", line 162, in <listcomp>
    [example_type(**eg) for eg in raw_examples] if raw_examples else None
     ^^^^^^^^^^^^^^^^^^
  File "pydantic/main.py", line 342, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for NERCoTExample
spans
  field required (type=value_error.missing)

@rmitsch
Copy link
Collaborator

rmitsch commented Oct 4, 2023

Can you post the content of your Examples.yaml? The examples required for CoT look a bit different, so you'll have to update those as well.

@innocent-charles
Copy link
Author

Hello @rmitsch , please may you share the structure of those new examples.

@rmitsch
Copy link
Collaborator

rmitsch commented Nov 27, 2023

The NER.v3 showcase in the repo includes examples.

@rmitsch rmitsch closed this as completed Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants