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

Issue with docquery document pydantic #68

Open
Priyankavinodh opened this issue Aug 17, 2023 · 6 comments
Open

Issue with docquery document pydantic #68

Priyankavinodh opened this issue Aug 17, 2023 · 6 comments

Comments

@Priyankavinodh
Copy link

Hi I'm facing the issues with pydantic
from pydantic.fields import ModelField
ImportError: cannot import name 'ModelField' from 'pydantic.fields'

with the python 3.8, 3.9, 3.10 also . Please suggest the solutions for this

@EmbroseBhati
Copy link

use earlier version of pydantic
!pip install "pydantic==1.*"

@dhineshkoilpitchai
Copy link

dhineshkoilpitchai commented Sep 11, 2023

Not able to install earlier version of pydantic==1.*

I am experiencing the same problem. If the issue has been resolved, please post it. This will assist me in moving forward.

@joaomaranhao
Copy link

@dhineshkoilpitchai
pip install pydantic==1.10

@khantthulinn
Copy link

khantthulinn commented Nov 13, 2023

I am implementing from my app in huggingface.

In my requirements.txt, I have written like this.

torch
pydantic==1.10
git+https://github.com/huggingface/transformers.git@21f6f58721dd9154357576be6de54eefef1f1818
git+https://github.com/impira/docquery.git@a494fe5af452d20011da75637aa82d246a869fa0#egg=docquery[web,donut]

But I am still having this error. How shall I do? How can I directly edit there?

===== Application Startup at 2023-11-13 04:50:05 =====

The cache for model files in Transformers v4.22.0 has been updated. Migrating your old cache. This is a one-time only operation. You can interrupt this and resume the migration later on by calling `transformers.utils.move_cache()`.
Moving 0 files to the new cache system
0it [00:00, ?it/s]
0it [00:00, ?it/s]
image-classification is already registered. Overwriting pipeline for task image-classification...
Traceback (most recent call last):
  File "/home/user/app/app.py", line 12, in <module>
    from docquery.document import load_document, ImageDocument
  File "/home/user/.local/lib/python3.10/site-packages/docquery/document.py", line 12, in <module>
    from .ocr_reader import NoOCRReaderFound, OCRReader, get_ocr_reader
  File "/home/user/.local/lib/python3.10/site-packages/docquery/ocr_reader.py", line 6, in <module>
    from pydantic.fields import ModelField
ImportError: cannot import name 'ModelField' from 'pydantic.fields' (/home/user/.local/lib/python3.10/site-packages/pydantic/fields.py)

https://huggingface.co/spaces/kenneth984/transcript_automation/

@yaroslavyaroslav
Copy link

@EmbroseBhati I'm good enough in pip dependencies, but is there a reason why this line isn't provided within the package itself?

@varun-affinsys
Copy link

varun-affinsys commented Aug 23, 2024

For users using Python3.9 and Ubuntu, below combination works:
(After pip install docquery)
transformers==4.23
pydantic==1.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants