Skip to content

Remove words from DQA output #1041

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

Closed
wants to merge 1 commit into from
Closed

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Nov 18, 2024

Related to (unfortunately) private slack convo (here).

originally from @Rocketknight1 :

Hey, for document-question-answering, the JS spec has "words", which is:
The index of each word/box pair that is in the answer
In transformers we don't output this at all. I'm not really sure how it's generated/used in the spec, since transformers already had start, end, answer, etc.

and then

Update: I think the words output never exists because of a pipeline bug. The pipeline has two code paths in several functions, one for VisionEncoderDecoder models and one for everything else.
In preprocess(), the VisionEncoderDecoder path always sets words to None which means it cannot be passed through to the output.
In postprocess() , the non-VisionEncoderDecoder path calls postprocess_extractive_qa. However, this function rewrites the answers dict without a words key
In other words, the preprocess() method deletes words for VisionEncoderDecoder models and the postprocess() method deletes it for everything else, so it always gets deleted! The right solution is just to remove it from the docstring and the JS spec.


Also to mention: DQA is only served from transformers in the Inference API.

@Wauplin
Copy link
Contributor Author

Wauplin commented Nov 18, 2024

(closing as duplicate of #1040)

@Wauplin Wauplin closed this Nov 18, 2024
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

Successfully merging this pull request may close these issues.

1 participant