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
'tuple' object has no attribute 'loss' #5
Comments
Hi @skye95git, I could not reproduce your issue. You can check whether the model is a |
Thanks for your reply! After I update the |
Hi, I want to experience the generated code of Codet5. How to use the model to generate code after fine-tuning? |
We currently do not have a plan to release the pre-training code, which should not be difficult to implement based on the paper. We are also happy to take questions regarding its implementation. |
You can refer to the following function for this: Line 84 in 100c7e5
|
Thanks for your reply! When I fine-tuning the model, I meet an error: There are many similar absolute paths in the repository. For example, It would be nice to be reminded in the readme that alternate paths are needed. |
I read the source code in I want to see the prediction result. Are the generated results of the test dataset stored in the What do Is input data stored in |
Hi, the paper describes |
Hi @skye95git, yes. Your understanding is correct. The |
We parse it using the tree-sitter similar to the CodeSearchNet dataset. We will release this additional data (C/C#) soon. |
That's cool. In addition to the additional data (C/C#) you will release, I want to parse the source code of C and C# that we obtained. Is it convenient for you to share the parsed code for C and C#? There is a fork of the awesome function_parser library from Github's CodeSearchNet Challenge repo. Currently, it supports 6 languages: Python, Java, Go, Php, Ruby, and Javascript. But it doesn't support C and C#. I tried to use the tree-sitter similar to the CodeSearchNet dataset to parse C and C#. Unfortunately, the effect isn't satisfactory. I would be grateful if you could share share the C and C# parse codes, I plan to fork it and update the function_parser. It can help more people. |
Hi, what is the difference between The description about CONCODE in If {
"code": "int function ( double [ ] arg0 , double [ ] arg1 ) { int loc0 = arg0 . length - arg1 . length ; outer : for ( int loc1 = 0 ; loc1 <= loc0 ; loc1 ++ ) { for ( int loc2 = 0 ; loc2 < arg1 . length ; loc2 ++ ) { if ( ne ( arg0 [ loc1 + loc2 ] , arg1 [ loc2 ] ) ) { continue outer ; } } return ( loc1 ) ; } return ( - 1 ) ; }",
"nl": "searches for the first subsequence of a that matches sub elementwise . elements of sub are considered to match elements of a if they pass the #eq test . concode_field_sep double max_ratio concode_elem_sep double min_ratio concode_elem_sep boolean off concode_field_sep boolean isElemMatch concode_elem_sep int compare concode_elem_sep boolean isSubset concode_elem_sep boolean ne concode_elem_sep boolean lt concode_elem_sep boolean gte concode_elem_sep void set_rel_diff concode_elem_sep boolean eq concode_elem_sep boolean lte concode_elem_sep boolean gt"
} The concode_field_sep double max_ratio
concode_elem_sep double min_ratio
concode_elem_sep boolean off
concode_field_sep boolean isElemMatch
concode_elem_sep int compare
concode_elem_sep boolean isSubset
concode_elem_sep boolean ne
concode_elem_sep boolean lt
concode_elem_sep boolean gte
concode_elem_sep void set_rel_diff
concode_elem_sep boolean eq
concode_elem_sep boolean lte
concode_elem_sep boolean gt The int function(double[] arg0, double[] arg1) {
int loc0 = arg0 . length - arg1 . length
outer: for (int loc1=0 loc1 <= loc0 loc1 + +) {
for (int loc2=0 loc2 < arg1 . length loc2 + +) {
if (ne(arg0[loc1 + loc2], arg1[loc2])) {
continue outer
}
}
return (loc1)
}
return (- 1)
} The |
Hi, I try to implement pre-training code. I have a couple of questions about the pre-training data:
CodeT5 uses less pre-training data than the original Codesearchnet data. Did you do data cleansing before pre-training? |
The data set used to fine-tune the code generation task is concode, which contains only the Java corpus. So can CodeT5 only generate Java code, or can all eight of the code used for pre-training be generated? If so, does that mean CodeT5 can generate code directly without fine-tuning it? |
Hi, I want to run CodeT5-base on code generation task. I run the command:
python run_exp.py --model_tag codet5_base --task concode --sub_task none
There is an error:
'tuple' object has no attribute 'loss'
.I try to change
outputs = model(input_ids=source_ids, attention_mask=source_mask, labels=target_ids, decoder_attention_mask=target_mask)
to
outputs, _ = model(input_ids=source_ids, attention_mask=source_mask, labels=target_ids, decoder_attention_mask=target_mask)
There is an error:
too many values to unpack (expected 2)
What should I do?
The text was updated successfully, but these errors were encountered: