Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -73,8 +73,18 @@ def summarize():
|
|
73 |
save_strategy="epoch", # Reduce checkpointing overhead
|
74 |
gradient_accumulation_steps=4 # Effective larger batch size
|
75 |
)
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
# return type(tokenized_billsum)
|
79 |
|
80 |
"""from fastapi import FastAPI
|
|
|
73 |
save_strategy="epoch", # Reduce checkpointing overhead
|
74 |
gradient_accumulation_steps=4 # Effective larger batch size
|
75 |
)
|
76 |
+
trainer = Seq2SeqTrainer(
|
77 |
+
model=model,
|
78 |
+
args=training_args,
|
79 |
+
train_dataset=tokenized_billsum["train"],
|
80 |
+
eval_dataset=tokenized_billsum["test"],
|
81 |
+
processing_class=tokenizer,
|
82 |
+
data_collator=data_collator,
|
83 |
+
compute_metrics=compute_metrics,
|
84 |
+
)
|
85 |
+
return trainer.train()
|
86 |
+
|
87 |
+
# return data_collator
|
88 |
# return type(tokenized_billsum)
|
89 |
|
90 |
"""from fastapi import FastAPI
|