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

Running tests locally fail #491

Closed
sroussey opened this issue Dec 30, 2023 · 3 comments · Fixed by #545
Closed

Running tests locally fail #491

sroussey opened this issue Dec 30, 2023 · 3 comments · Fixed by #545
Labels
question Further information is requested

Comments

@sroussey
Copy link

Question

When I git clone to my Mac, and run tests, I get a lot of errors:

  ● Models › Loading different architecture types › gpt2 (GPT2Model)

    Could not locate file: "https://huggingface.co/gpt2/resolve/main/tokenizer_config.json".

      239 |
      240 |     const message = ERROR_MAPPING[status] ?? `Error (${status}) occurred while trying to load file`;
    > 241 |     throw Error(`${message}: "${remoteURL}".`);
          |           ^
      242 | }
      243 |
      244 | class FileCache {

      at handleError (src/utils/hub.js:241:11)
      at getModelFile (src/utils/hub.js:474:24)
      at getModelJSON (src/utils/hub.js:575:18)
          at async Promise.all (index 1)
      at loadTokenizer (src/tokenizers.js:61:16)
      at Function.from_pretrained (src/tokenizers.js:2465:20)
      at Object.<anonymous> (tests/models.test.js:61:37)

And indeed, a lot of files don't actually exist, like in this case:

https://huggingface.co/gpt2/resolve/main/tokenizer_config.json

But I don't see this in the logs for your github actions, so i am confused.

@sroussey sroussey added the question Further information is requested label Dec 30, 2023
@sroussey
Copy link
Author

Oh, I see what you did. Local tests are.... optimistic.

Perhaps a better way would be to try optimistic, and if it fails, then use your copies?

@sroussey
Copy link
Author

BTW: you can have github actions cache your .cache folder, but you would need a decent cache key.

@xenova
Copy link
Collaborator

xenova commented Dec 30, 2023

Hi there 👋 This behaviour was taken over from a very early version of the project (v1), where I would just name the models the same as they are on the HF Hub, and store the model weights under my HF account under a single repo. Since v2, a change was needed to run with github actions, so I introduced the TESTING_REMOTELY environment variable to link to models under the Xenova account on HF. So, if you want to test locally, you can set TESTING_REMOTELY=1 (a bit confusing I guess), which will use the web-ready versions.

A follow-up PR will be ideal to improve this.

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

Successfully merging a pull request may close this issue.

2 participants