Giter Club home page Giter Club logo

Comments (5)

wasiahmad avatar wasiahmad commented on July 23, 2024

Too many information and thus unable to understand the problem. I don't see any eval_blue script too. Please look at the code for other models.

from avatar.

Gugutse avatar Gugutse commented on July 23, 2024

eval_bleu is here: https://github.com/wasiahmad/AVATAR/blob/main/codegpt/run.py

for step, (batch, token_labels) in enumerate(test_dataloader):
        inputs = batch.to(args.device)
        with torch.no_grad():
            beam_size = args.beam_size
            m = torch.nn.LogSoftmax(dim=-1)
            outputs = model(inputs)[1]
            p = []
            zero = torch.cuda.LongTensor(1).fill_(0)
            for i in range(inputs.shape[0]):
                past_hidden = [x[:, i:i + 1].expand(-1, beam_size, -1, -1, -1) for x in outputs]

I would like to evaluate the model, but the error TypeError: tuple indices must be integers or slices, not tuple occurs on the line past_hidden = [x[:, i:i + 1].expand(-1, beam_size, -1, -1, -1) for x in outputs]

from avatar.

wasiahmad avatar wasiahmad commented on July 23, 2024

I am not sure. The CodeGPT codebase is supposed to work fine. I am not sure why you are getting this error. I will run again in my environment to see if CodeGPT training and evaluation work correctly.

from avatar.

Gugutse avatar Gugutse commented on July 23, 2024

The problem is that GPT-2 model's output format has changed in the newer versions of Huggingface's transformers library – thus, it needs to apply torch.stack() to the output.

from avatar.

wasiahmad avatar wasiahmad commented on July 23, 2024

I see, you can modify the code to be compatible with the newer versions of the transformers API. I am closing this issue for now.

from avatar.

Related Issues (12)

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.