Giter Site home page Giter Site logo

Comments (5)

yuewang-cuhk avatar yuewang-cuhk commented on June 21, 2024 1

Hello, are you able to run the example script here? I've double check it and can run it successfully.

I guess the reason for the above error you faced is due to that you load the model from a local folder instead of from the remote HuggingFace hub. To load the local model checkpoint, you'll have to download the class and config files. Below is the example code to load the local model:

from modeling_codet5p_embedding import CodeT5pEmbeddingModel
model = CodeT5pEmbeddingModel.from_pretrained(checkpoint)

from codet5.

pdhung3012 avatar pdhung3012 commented on June 21, 2024

Hello. After checking the error, I investigate that the reason is due to the codet5p_embedding hasn't been a key defined in this file:
https://github.com/huggingface/transformers/blob/main/src/transformers/models/auto/configuration_auto.py

I check in the latest version on Github they didn't define that key. Is that key specific to your machine (or did you update the configuration_auto.py file specifically compared to the general version)?

from codet5.

pdhung3012 avatar pdhung3012 commented on June 21, 2024

Thank you for your help. Yes, at first I ran the script on my local ubuntu 22.04 server (which the code called to the remoted HuggingFace hub "Salesforce/codet5p-110m-embedding") but it returned the same error. Thus, I changed to download the model to my local machine to call but the error still remained.
Let me try again.

from codet5.

pdhung3012 avatar pdhung3012 commented on June 21, 2024

I tried to load it remotely from huggingface remote side. It shows the error like this:

`
OSError: Can't load 'Salesforce/codet5p-110m-embedding'. Make sure that:

  • 'Salesforce/codet5p-110m-embedding' is a correct model identifier listed on 'https://huggingface.co/models'

  • or 'Salesforce/codet5p-110m-embedding' is the correct path to a directory containing a 'config.json' file`

from codet5.

pdhung3012 avatar pdhung3012 commented on June 21, 2024

I checked the version of my transformer. I used the old version of transformers as 4.11.3, while the current version is 4.32.1. reinstall my transformer and it worked. Thanks for your help.

from codet5.

Related Issues (20)

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.