Kevin Fink
commited on
Commit
·
40f1713
1
Parent(s):
e4474ca
deve
Browse files
app.py
CHANGED
@@ -109,9 +109,9 @@ def fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size
|
|
109 |
examples['text'],
|
110 |
#max_length=max_length, # Set to None for dynamic padding
|
111 |
truncation=True,
|
112 |
-
|
113 |
#return_tensors='pt',
|
114 |
-
padding=True,
|
115 |
)
|
116 |
|
117 |
# Setup the decoder input IDs (shifted right)
|
@@ -119,10 +119,10 @@ def fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size
|
|
119 |
examples['target'],
|
120 |
#max_length=128, # Set to None for dynamic padding
|
121 |
truncation=True,
|
122 |
-
|
123 |
#text_target=examples['target'],
|
124 |
#return_tensors='pt',
|
125 |
-
padding=True,
|
126 |
)
|
127 |
#labels["input_ids"] = [
|
128 |
# [(l if l != tokenizer.pad_token_id else -100) for l in label] for label in labels["input_ids"]
|
|
|
109 |
examples['text'],
|
110 |
#max_length=max_length, # Set to None for dynamic padding
|
111 |
truncation=True,
|
112 |
+
padding='max_length',
|
113 |
#return_tensors='pt',
|
114 |
+
#padding=True,
|
115 |
)
|
116 |
|
117 |
# Setup the decoder input IDs (shifted right)
|
|
|
119 |
examples['target'],
|
120 |
#max_length=128, # Set to None for dynamic padding
|
121 |
truncation=True,
|
122 |
+
padding='max_length',
|
123 |
#text_target=examples['target'],
|
124 |
#return_tensors='pt',
|
125 |
+
#padding=True,
|
126 |
)
|
127 |
#labels["input_ids"] = [
|
128 |
# [(l if l != tokenizer.pad_token_id else -100) for l in label] for label in labels["input_ids"]
|