Skip to content
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

there may be a bug in cooccur.c when the bin file is empty #218

Open
cicido opened this issue Aug 23, 2023 · 1 comment
Open

there may be a bug in cooccur.c when the bin file is empty #218

cicido opened this issue Aug 23, 2023 · 1 comment

Comments

@cicido
Copy link

cicido commented Aug 23, 2023

in file cooccur.c line 177-184
for (i = 0; i < num; i++) {
sprintf(filename,"%s_%04d.bin",file_head,i);
fid[i] = fopen(filename,"rb");
if (fid[i] == NULL) {log_file_loading_error("file", filename); free_fid(fid, num); free(pq); return 1;}
fread(&new, sizeof(CREC), 1, fid[i]);
new.id = i;
insert(pq,new,i+1);
}
when the content in "filename" is empty, the CREC new will computer twice。
let's see the corpus has only the following words:
"training the vectors can be speeded up by increasing the training parallelism to match the number of physical CPU cores available"
there will generate two bin files, and one of files is empty.

@AngledLuffa
Copy link
Contributor

 when the content in "filename" is empty, the CREC new will computer twice。

Please clarify what you mean by this.  sizeof(CREC) will be the size of the C object, not the data file itself.

In terms of git usage, it will be easier to follow newly posted issues if you:

  • use ``` to denote code blocks. it will look like this:
asdf {
  stuff;
}
  • link to the lines of code you are interested in. if you click on the line number on github, three dots should show up. one of the options will be copy permalink. for example

// GloVe: Global Vectors for Word Representation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants