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

Bugs in document parse SDK API #4516

Open
user-cjw opened this issue Jan 17, 2025 · 0 comments
Open

Bugs in document parse SDK API #4516

user-cjw opened this issue Jan 17, 2025 · 0 comments

Comments

@user-cjw
Copy link

user-cjw commented Jan 17, 2025

ragflow/api/apps/sdk/doc.py

Lines 726 to 729 in c0799c5

if int(doc[0].progress) == 1 or int(doc[0].progress) == 0:
return get_error_data_result(
"Can't stop parsing document with progress at 0 or 1"
)

Document.progress is a float between 0.0 and 1.0, so the condition here will always be true. It makes parsing tasks unstoppable via SDK API. The correct condition should be doc[0].progress<=0.0 or doc[0].progress==1.0, i.e. can't stop tasks not started, finished, or stop with errors.

ragflow/api/apps/sdk/doc.py

Lines 659 to 662 in c0799c5

if doc[0].progress != 0.0:
return get_error_data_result(
"Can't stop parsing document with progress at 0 or 100"
)

In the same file, the error string here should be "Can't start parsing document with progress unequal to 0.0" (or document with errors or already started parsing) right?

KevinHuSh added a commit that referenced this issue Jan 17, 2025
### What problem does this PR solve?

#4516
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
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

1 participant