Kevin Fink commited on
Commit
506a330
·
1 Parent(s): 2a237b2
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -94,15 +94,13 @@ def fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size
94
  model_inputs = tokenizer(
95
  examples['text'],
96
  max_length=max_length, # Set to None for dynamic padding
97
- padding=True, # Disable padding here, we will handle it later
98
- truncation=True,
99
  )
100
 
101
  # Setup the decoder input IDs (shifted right)
102
  labels = tokenizer(
103
  examples['target'],
104
  max_length=max_length, # Set to None for dynamic padding
105
- padding=True, # Disable padding here, we will handle it later
106
  truncation=True,
107
  text_target=examples['target'] # Use text_target for target text
108
  )
 
94
  model_inputs = tokenizer(
95
  examples['text'],
96
  max_length=max_length, # Set to None for dynamic padding
97
+ truncation='max_length',
 
98
  )
99
 
100
  # Setup the decoder input IDs (shifted right)
101
  labels = tokenizer(
102
  examples['target'],
103
  max_length=max_length, # Set to None for dynamic padding
 
104
  truncation=True,
105
  text_target=examples['target'] # Use text_target for target text
106
  )