Coder Social home page Coder Social logo

AH01215: OSError: Couldn't reach server at 'https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-config.json' to download pretrained model configuration file about lm-scorer HOT 6 CLOSED

simonepri avatar simonepri commented on July 21, 2024
AH01215: OSError: Couldn't reach server at 'https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-config.json' to download pretrained model configuration file

from lm-scorer.

Comments (6)

simonepri avatar simonepri commented on July 21, 2024

It seems to work in the terminal.

What do you mean?

Can you please explain step by step what are you doing and how to reproduce the problem?
If the problem only happen inside Vegrant can you provide a minimum Vegrantfile that generates the problem?

Thanks

from lm-scorer.

MSMOON avatar MSMOON commented on July 21, 2024

Here is what I have just to see if I can get a language model(gpt2) to load.
I'm getting:

OSError: Couldn't reach server at 'https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-config.json' to download pretrained model configuration file.

https://drive.google.com/file/d/1gRvVE13UhGBnvUZCsiiip5gGluGdMRnw/view?usp=sharing

from lm-scorer.

simonepri avatar simonepri commented on July 21, 2024

The link you shared is private.
Anyway it is likely to be a misconfiguration on your machine rather than a problem with this library.
What the errors is telling you is that the machine is unable to download the model from the server.

from lm-scorer.

BramVanroy avatar BramVanroy commented on July 21, 2024

It is for exactly this reason that I added the local_files_only directive. This avoids our going connections and only looks for the local files (in cache or in the specified location). It seems that the LMScorer currently doesn't pass kwargs down to the actual 'from_pretrained' method, hence the following would not work.

scorer = LMScorer.from_pretrained("gpt2", local_files_only=True)

It might be helpful if options were passed down to the actual from_pretrained method.

from lm-scorer.

MSMOON avatar MSMOON commented on July 21, 2024

To you both, thanks for your help!
Currently this is my situation. I am using GPT2 with local files successfully.

However, this line..
scorer = LMScorer.from_pretrained("gpt2", device=device, batch_size=batch_size)
is failing because it still wants to access s3.amazonaws.com and is looking for the model names (["gpt2", "gpt2-medium", "gpt2-large", "gpt2-xl", distilgpt2"])

ValueError: Unrecognized model name.Can be one of: gpt2, gpt2-medium, gpt2-large, gpt2-xl, distilgpt2

However, I need it to recognize my gpt2 local files. Is there a way to use lm-scorer by using gpt2 local files?

My apologies. The link should work now. https://drive.google.com/file/d/1UEybSOF88vwcVVSYgut7WIOo2l4iprk0/view?usp=sharing

from lm-scorer.

MSMOON avatar MSMOON commented on July 21, 2024

I was able to finally able to figure out my problem with loading gpt2 and other python modules by changing the envvars file described here: https://stackoverflow.com/questions/3783887/why-cant-python-find-some-modules-when-im-running-cgi-scripts-from-the-web

from lm-scorer.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.