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

BUG: AutoModel.from_pretrained(modelName) #34709

Open
2 of 4 tasks
NarwhalChen opened this issue Nov 12, 2024 · 0 comments
Open
2 of 4 tasks

BUG: AutoModel.from_pretrained(modelName) #34709

NarwhalChen opened this issue Nov 12, 2024 · 0 comments
Labels

Comments

@NarwhalChen
Copy link

NarwhalChen commented Nov 12, 2024

System Info

when using AutoModel.from_pretrained(modelName) it has error message Error: Could not locate file: "https://huggingface.co/google-bert/bert-base-uncased/resolve/main/onnx/model.onnx", but there is nothing in this url, and i think the bug is in file src/transformers/utils/hub.py, line 149
HUGGINGFACE_CO_PREFIX = HUGGINGFACE_CO_RESOLVE_ENDPOINT + "/{model_id}/resolve/{revision}/{filename}"
image

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

async function loadModel(modelName: string) {

    console.log(modelName);
try {
    const tokenizer = await AutoTokenizer.from_pretrained(modelName);
    const model = await AutoModel.from_pretrained(modelName);
    
    console.log(model);
    console.log(tokenizer);
    return { model, tokenizer };
} catch (error) {
    console.log(error);
    return null;
}

}
and report
try {
8 | const tokenizer = await AutoTokenizer.from_pretrained(modelName);
> 9 | const model = await AutoModel.from_pretrained(modelName);
| ^
10 |
11 | console.log(model);
12 | console.log(tokenizer);

  at getSession (node_modules/.pnpm/@[email protected]/node_modules/@huggingface/transformers/dist/webpack:/@huggingface/transformers/src/models.js:178:1)
  at node_modules/.pnpm/@[email protected]/node_modules/@huggingface/transformers/dist/webpack:/@huggingface/transformers/src/models.js:297:63
      at Array.map (<anonymous>)
  at constructSessions (node_modules/.pnpm/@[email protected]/node_modules/@huggingface/transformers/dist/webpack:/@huggingface/transformers/src/models.js:296:1)
  at Function.from_pretrained (node_modules/.pnpm/@[email protected]/node_modules/@huggingface/transformers/dist/webpack:/@huggingface/transformers/src/models.js:920:1)
  at Function.from_pretrained (node_modules/.pnpm/@[email protected]/node_modules/@huggingface/transformers/dist/webpack:/@huggingface/transformers/src/models.js:6034:1)
  at loadModel (src/model/model.service.ts:9:23)
  at loadAllChatsModels (src/model/model.service.ts:28:31)
  at Object.<anonymous> (__tests__/loadAllChatsModels.spec.ts:23:9)

console.log
Error: Could not locate file: "https://huggingface.co/google-bert/bert-base-uncased/resolve/main/onnx/model.onnx".

Expected behavior

expected to pull model in true url

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant