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

load local model #5

Open
zhilonglu opened this issue Apr 21, 2023 · 0 comments
Open

load local model #5

zhilonglu opened this issue Apr 21, 2023 · 0 comments

Comments

@zhilonglu
Copy link

hello,when i try to run the QGwithAns code, I download the model from hugging face and save in the local path.
butu when load the model from local path, there is an error occur.
nlp = T5_QG.pipeline("question-generation", model='valhalla/t5-base-qg-hl', qg_format="highlight")
I change the model para above to local path like './Pretrained_Models/t5_base_qg_hl'
nlp = T5_QG.pipeline("question-generation", model='./Pretrained_Models/t5_base_qg_hl', qg_format="highlight")
but there is an error below.
│ 307 │ │ return _sentencepiece.SentencePieceProcessor_serialized_model │
│ 308 │ │
│ 309 │ def LoadFromFile(self, arg): │
│ ❱ 310 │ │ return _sentencepiece.SentencePieceProcessor_LoadFromFile(sel │
│ 311 │ │
│ 312 │ def _EncodeAsIds(self, text, enable_sampling, nbest_size, alpha, │
│ 313 │ │ return _sentencepiece.SentencePieceProcessor__EncodeAsIds(sel │
╰──────────────────────────────────────────────────────────────────────────────╯
TypeError: not a string

how to fix it?

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