Kevin Fink commited on
Commit
e1dcc24
·
1 Parent(s): b44eeef
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -72,7 +72,8 @@ def fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size
72
  print("Loading model from checkpoint...")
73
  model = AutoModelForSeq2SeqLM.from_pretrained(training_args.output_dir)
74
 
75
- max_length = 128
 
76
  try:
77
  tokenized_train_dataset = load_from_disk(f'/data/{hub_id.strip()}_train_dataset')
78
  tokenized_test_dataset = load_from_disk(f'/data/{hub_id.strip()}_test_dataset')
 
72
  print("Loading model from checkpoint...")
73
  model = AutoModelForSeq2SeqLM.from_pretrained(training_args.output_dir)
74
 
75
+ #max_length = 128
76
+ max_length = model.get_input_embeddings().weight.shape[0]
77
  try:
78
  tokenized_train_dataset = load_from_disk(f'/data/{hub_id.strip()}_train_dataset')
79
  tokenized_test_dataset = load_from_disk(f'/data/{hub_id.strip()}_test_dataset')