Kevin Fink
commited on
Commit
·
d767c85
1
Parent(s):
1a738f8
deve
Browse files
app.py
CHANGED
@@ -95,8 +95,8 @@ def fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size
|
|
95 |
#if os.path.exists(training_args.output_dir) and os.listdir(training_args.output_dir):
|
96 |
#print("Loading model from checkpoint...")
|
97 |
#model = AutoModelForSeq2SeqLM.from_pretrained(training_args.output_dir)
|
98 |
-
|
99 |
-
tokenizer = AutoTokenizer.from_pretrained('google/t5-efficient-tiny', use_fast=True, trust_remote_code=True)
|
100 |
|
101 |
#max_length = model.get_input_embeddings().weight.shape[0]
|
102 |
max_length = 512
|
@@ -268,7 +268,7 @@ def run_train(dataset_name, hub_id, api_key, num_epochs, batch_size, lr, grad):
|
|
268 |
elif 'encoder.block.0.layer.0.DenseReluDense.wo.weight' in name: # Another example layer
|
269 |
torch.nn.init.kaiming_normal_(param.data) # Kaiming initialization
|
270 |
|
271 |
-
config = AutoConfig.from_pretrained("google/t5-efficient-tiny")
|
272 |
model = AutoModelForSeq2SeqLM.from_config(config)
|
273 |
initialize_weights(model)
|
274 |
lora_config = LoraConfig(
|
|
|
95 |
#if os.path.exists(training_args.output_dir) and os.listdir(training_args.output_dir):
|
96 |
#print("Loading model from checkpoint...")
|
97 |
#model = AutoModelForSeq2SeqLM.from_pretrained(training_args.output_dir)
|
98 |
+
config = AutoConfig.from_pretrained("google/t5-efficient-tiny-nh8")
|
99 |
+
tokenizer = AutoTokenizer.from_pretrained('google/t5-efficient-tiny-nh8', use_fast=True, trust_remote_code=True)
|
100 |
|
101 |
#max_length = model.get_input_embeddings().weight.shape[0]
|
102 |
max_length = 512
|
|
|
268 |
elif 'encoder.block.0.layer.0.DenseReluDense.wo.weight' in name: # Another example layer
|
269 |
torch.nn.init.kaiming_normal_(param.data) # Kaiming initialization
|
270 |
|
271 |
+
config = AutoConfig.from_pretrained("google/t5-efficient-tiny-nh8")
|
272 |
model = AutoModelForSeq2SeqLM.from_config(config)
|
273 |
initialize_weights(model)
|
274 |
lora_config = LoraConfig(
|