Skip to content

Commit

Permalink
ruff linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankJonasmoelle committed May 14, 2024
1 parent 172aae3 commit 53b3d4f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions examples/huggingface/client/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,13 @@ def validate(in_model_path, out_json_path, data_path=None):

# test dataset
tokenizer = AutoTokenizer.from_pretrained(MODEL)
train_encodings = tokenizer(
X_train, truncation=True, padding="max_length", max_length=512
)
test_encodings = tokenizer(
X_test, truncation=True, padding="max_length", max_length=512
)
train_dataset = SpamDataset(train_encodings, y_train)
test_encodings = tokenizer(X_test, truncation=True, padding="max_length", max_length=512)
test_dataset = SpamDataset(test_encodings, y_test)

# Load model
model = load_parameters(in_model_path)
model.eval()

train_loader = DataLoader(train_dataset, batch_size=16, shuffle=True)
test_loader = DataLoader(test_dataset, batch_size=16, shuffle=True)

device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
Expand Down

0 comments on commit 53b3d4f

Please sign in to comment.