Comments (5)
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.
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.
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.
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.
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)
- evaluating TransCoder on AVATAR test set and bug in compile.py? HOT 3
- Unable to reproduce CodeT5 results HOT 1
- How did you select the samples in g4g-functions? HOT 2
- Buggy test set? HOT 2
- Could you please help provide the trained model parameters? HOT 1
- Are the downloaded plbart checkpoints pretrained already HOT 4
- Absent new_lines and indentation in python data HOT 2
- Preprocessing HOT 1
- Two questions about the AVATAR paper HOT 6
- Typo Bug: Undefined 'tag' in DFG_java and DFG_csharp HOT 1
- download error of the pretrained ckpts you shared HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avatar.