Skip to content

Commit cb2d374

Browse files
committed
saved with correct format
1 parent 13138ea commit cb2d374

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

tests/data/huggingface/run_tf.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@
5757
)
5858
train_dataset.set_format(type="tensorflow", columns=["input_ids", "attention_mask", "label"])
5959

60-
train_features = {
61-
x: train_dataset[x].to_tensor(default_value=0, shape=[None, tokenizer.model_max_length])
62-
for x in ["input_ids", "attention_mask"]
63-
}
60+
train_features = {x: train_dataset[x] for x in ["input_ids", "attention_mask"]}
61+
6462
tf_train_dataset = tf.data.Dataset.from_tensor_slices(
6563
(train_features, train_dataset["label"])
6664
).batch(args.per_device_train_batch_size)
@@ -71,10 +69,8 @@
7169
)
7270
test_dataset.set_format(type="tensorflow", columns=["input_ids", "attention_mask", "label"])
7371

74-
test_features = {
75-
x: test_dataset[x].to_tensor(default_value=0, shape=[None, tokenizer.model_max_length])
76-
for x in ["input_ids", "attention_mask"]
77-
}
72+
test_features = {x: test_dataset[x] for x in ["input_ids", "attention_mask"]}
73+
7874
tf_test_dataset = tf.data.Dataset.from_tensor_slices(
7975
(test_features, test_dataset["label"])
8076
).batch(args.per_device_eval_batch_size)

tests/integ/test_huggingface.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def test_huggingface_inference(
158158
huggingface_pytorch_latest_inference_py_version,
159159
):
160160
env = {
161-
"HF_MODEL_ID": "sshleifer/tiny-distilbert-base-uncased-finetuned-sst-2-english",
161+
"HF_MODEL_ID": "philschmid/tiny-distilbert-classification",
162162
"HF_TASK": "text-classification",
163163
}
164164
endpoint_name = unique_name_from_base("test-hf-inference")

0 commit comments

Comments
 (0)