Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -32,8 +32,8 @@ train_texts, val_texts, train_labels, val_labels = train_test_split(
|
|
32 |
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
|
33 |
|
34 |
# Tokenize the conversations
|
35 |
-
train_encodings = tokenizer(train_texts, truncation=True, padding=True, max_length=
|
36 |
-
val_encodings = tokenizer(val_texts, truncation=True, padding=True, max_length=
|
37 |
|
38 |
# Create PyTorch datasets
|
39 |
train_dataset = Dataset.from_dict({
|
@@ -59,8 +59,8 @@ training_args = TrainingArguments(
|
|
59 |
eval_strategy='epoch', # Evaluate at the end of each epoch
|
60 |
save_strategy='epoch', # Save model at the end of each epoch
|
61 |
learning_rate=2e-5,
|
62 |
-
per_device_train_batch_size=
|
63 |
-
per_device_eval_batch_size=
|
64 |
num_train_epochs=3,
|
65 |
weight_decay=0.01,
|
66 |
logging_dir='./logs',
|
|
|
32 |
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
|
33 |
|
34 |
# Tokenize the conversations
|
35 |
+
train_encodings = tokenizer(train_texts, truncation=True, padding=True, max_length=128)
|
36 |
+
val_encodings = tokenizer(val_texts, truncation=True, padding=True, max_length=128)
|
37 |
|
38 |
# Create PyTorch datasets
|
39 |
train_dataset = Dataset.from_dict({
|
|
|
59 |
eval_strategy='epoch', # Evaluate at the end of each epoch
|
60 |
save_strategy='epoch', # Save model at the end of each epoch
|
61 |
learning_rate=2e-5,
|
62 |
+
per_device_train_batch_size=12,
|
63 |
+
per_device_eval_batch_size=12,
|
64 |
num_train_epochs=3,
|
65 |
weight_decay=0.01,
|
66 |
logging_dir='./logs',
|