fix : If image_processor is not empty, then use it,same with tokenizer #67
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello @VikParuchuri , I saw the Surya project and it is great
I used the official python code locally without any problems. The model would be downloaded remotely from huggingface to the local computer, and then parsed and executed. However, when I tested it on the server, I found some problems.
For some reason, the server cannot access huggingface, so the model file can only be downloaded to the server manually, and then the model loading directory is specified through code.
Official code example:
I looked at the source code
SuryaProcessor
and there are some problems with the initialization method.The
image_processor
andtokenizer
passed by this method will not have any effect. Even if they are passed when initializing theSuryaProcessor
object, I cannot change the problem of using the local directory to load the model.So in order to debug the current code on the server, I can only rewrite a new class to inherit
SuryaProcessor
to change the problem thatimage_processor
andtokenizer
do not take effect. This is the code I tested on the server, as follows:Therefore, I think the constructor of
SuryaProcessor
should be compatible with external parameters passed