Skip to content
Snippets Groups Projects
Commit bac1ee50 authored by Julien Breton's avatar Julien Breton
Browse files

Merge remote-tracking branch 'origin/main'

parents 029e81d0 6cf88b0d
No related branches found
No related tags found
No related merge requests found
......@@ -89,8 +89,12 @@ def fine_tune(base_model, new_model):
trainer.model.save_pretrained(new_model)
model.config.use_cache = True
model.eval()
del model, trainer, tokenizer
def generate(base_model, new_model):
# Clear the memory footprint
torch.cuda.empty_cache()
base_model_reload = transformers.AutoModelForCausalLM.from_pretrained(
base_model,
......@@ -174,4 +178,6 @@ minutes = (execution_time % 3600) // 60
seconds = execution_time % 60
# Print the execution time in hours, minutes, and seconds
print(f"The program ran for {int(hours)} hours, {int(minutes)} minutes, and {seconds:.2f} seconds.")
\ No newline at end of file
print(f"The program ran for {int(hours)} hours, {int(minutes)} minutes, and {seconds:.2f} seconds.")
#100%|██████████| 306/306 [1:05:20<00:00, 12.81s/it]
\ No newline at end of file
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment