Skip to content

Commit

Permalink
simpler structure: remove eval & dataset dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
jettjaniak committed May 22, 2024
1 parent 784c8f2 commit a5a3999
Show file tree
Hide file tree
Showing 20 changed files with 596 additions and 655 deletions.
86 changes: 43 additions & 43 deletions notebooks/eval_notebook.ipynb

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions scripts/get_next_logprobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from transformers import AutoModelForCausalLM

from delphi import utils
from delphi.eval.utils import get_all_and_next_logprobs

torch.set_grad_enabled(False)

Expand Down Expand Up @@ -61,7 +60,7 @@ def get_logprobs_single_model(
for i in trange(0, n_seq, batch_size):
batch_tokens = dataset[i : i + batch_size][feature]
logprobs[i : i + batch_size, 1:] = (
get_all_and_next_logprobs(model, batch_tokens)[1].cpu().numpy() # type: ignore
utils.get_all_and_next_logprobs(model, batch_tokens)[1].cpu().numpy() # type: ignore
)
return Dataset.from_dict({"logprobs": [row for row in logprobs]})

Expand Down
2 changes: 1 addition & 1 deletion scripts/tokenize_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from transformers import AutoTokenizer

from delphi import utils
from delphi.dataset.tokenization import get_tokenized_chunks
from delphi.tokenization import get_tokenized_chunks

if __name__ == "__main__":
parser = argparse.ArgumentParser(description="", allow_abbrev=False)
Expand Down
Empty file removed src/delphi/dataset/__init__.py
Empty file.
Loading

0 comments on commit a5a3999

Please sign in to comment.