#Kamal Shrestha
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from torch.utils.data import Dataset | |
class CustomTrainDataset(Dataset): | |
def __init__(self, df, tokenizer): | |
self.df = df | |
self.tokenizer = tokenizer | |
def __len__(self): | |
return len(self.df) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Pytest Notes | |
Tests increases your confidence that the code behaves as you expect and ensures that changes to your code won’t cause regressions. | |
- Several short comming of unittest | |
- Need to import Test case class | |
- Define a function for each test cases | |
- | |
- With pytest common t tasks takes les code time saving commands for advanced tasks |
NewerOlder