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

An error occurred during from itext2kg import DocumentDistiller #27

Open
againcui opened this issue Nov 27, 2024 · 4 comments
Open

An error occurred during from itext2kg import DocumentDistiller #27

againcui opened this issue Nov 27, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@againcui
Copy link

Hello:
when i import DocumentDistiller,The following error message is displayed ' ValueError: no signature found for builtin '
How can I solve it, thanks!

@lairgiyassir lairgiyassir added the bug Something isn't working label Nov 27, 2024
@lairgiyassir
Copy link
Collaborator

Hello,

Could you provide the full traceback of the error?
Thank you

@againcui
Copy link
Author

Hello,

Could you provide the full traceback of the error? Thank you

The following is, thank you very much for your hard work


Traceback (most recent call last):
File "/data/home/zewen.cui/GraphRAG/iText2KG_czw/run.py", line 5, in
from itext2kg import DocumentDistiller
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/itext2kg/init.py", line 1, in
from .documents_distiller import DocumentsDistiller
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/itext2kg/documents_distiller/init.py", line 1, in
from .documents_distiller import DocumentsDistiller
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/itext2kg/documents_distiller/documents_distiller.py", line 2, in
from ..utils import LangchainOutputParser
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/itext2kg/utils/init.py", line 3, in
from .matcher import Matcher
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/itext2kg/utils/matcher.py", line 4, in
from ..models import Entity, Relationship
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/itext2kg/models/init.py", line 1, in
from .knowledge_graph import Entity, Relationship, KnowledgeGraph
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/itext2kg/models/knowledge_graph.py", line 6, in
class EntityProperties(BaseModel):
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py", line 226, in new
complete_model_class(
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py", line 658, in complete_model_class
schema = cls.get_pydantic_core_schema(cls, handler)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/main.py", line 702, in get_pydantic_core_schema
return handler(source)
^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 84, in call
schema = self._handler(source_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 612, in generate_schema
schema = self._generate_schema_inner(obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 881, in _generate_schema_inner
return self._model_schema(obj)
^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 693, in _model_schema
{k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 693, in
{k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1073, in _generate_md_field_schema
common_field = self._common_field_schema(name, field_info, decorators)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1265, in _common_field_schema
schema = self._apply_annotations(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2062, in _apply_annotations
schema = get_inner_schema(source_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 84, in call
schema = self._handler(source_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2137, in new_handler
schema = metadata_get_schema(source, get_inner_schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/functional_validators.py", line 837, in get_pydantic_core_schema
original_schema = handler(source)
^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 84, in call
schema = self._handler(source_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2043, in inner_handler
schema = self._generate_schema_inner(obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 886, in _generate_schema_inner
return self.match_type(obj)
^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 977, in match_type
return self._call_schema(obj)
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1818, in _call_schema
sig = signature(function)
^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/inspect.py", line 3263, in signature
return Signature.from_callable(obj, follow_wrapped=follow_wrapped,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/inspect.py", line 3011, in from_callable
return _signature_from_callable(obj, sigcls=cls,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/inspect.py", line 2528, in _signature_from_callable
return _signature_from_builtin(sigcls, obj,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/GraphRAG/lib/python3.11/inspect.py", line 2326, in _signature_from_builtin
raise ValueError("no signature found for builtin {!r}".format(func))
ValueError: no signature found for builtin

@wenjiezy
Copy link

wenjiezy commented Nov 28, 2024

I have the same issue.
Everything goes fine after changing the "np.array" to "np.ndarray" in "itext2kg/models/knowledge_graph.py" line 7 and 12.

@lairgiyassir
Copy link
Collaborator

I think this is an error coming from pydantic. The same issue was reported here #26

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

3 participants