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

max-model-input-length argument not working in prepare input, lead to python kernel crash #737

Open
JasonRichard opened this issue Nov 1, 2024 · 1 comment
Assignees
Labels
bug Something isn't working topic:NLP Issue or PR about NLP model support and eland_import_hub_model

Comments

@JasonRichard
Copy link

eland/eland/ml/pytorch/transformers.py

max-model-input-length argument not working in prepare input,
max_length uses max_length from model weight/config.json
leads to python kernel crash when max_length is too large

class _TraceableTextEmbeddingModel(_TransformerTraceableModel):
    def _prepare_inputs(self) -> transformers.BatchEncoding:
        return self._tokenizer(
            "This is an example sentence.",
            padding="max_length", #may lead to python kernel crash
            return_tensors="pt",
        )

Image

maybe change it to 'longest' ?

@davidkyle davidkyle self-assigned this Nov 4, 2024
@davidkyle davidkyle added bug Something isn't working topic:NLP Issue or PR about NLP model support and eland_import_hub_model labels Nov 4, 2024
@davidkyle
Copy link
Member

Hi @JasonRichard

Which model were you importing when you saw the error and please can you share the command you do use so I can reproduce the error. And which version of Eland are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working topic:NLP Issue or PR about NLP model support and eland_import_hub_model
Projects
None yet
Development

No branches or pull requests

2 participants