Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
saattrupdan committed Sep 27, 2024
1 parent 1202776 commit d0ce95c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/coral/finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
import os

from omegaconf import DictConfig
from transformers import EarlyStoppingCallback, TrainerCallback
from transformers import (
AutoModelForCTC,
AutoProcessor,
EarlyStoppingCallback,
TrainerCallback,
)
from wandb.sdk.wandb_init import init as wandb_init

from .data import load_data_for_finetuning
Expand All @@ -31,6 +36,10 @@ def finetune(config: DictConfig) -> None:
model = model_setup.load_model()
dataset = load_data_for_finetuning(config=config, processor=processor)

# TEMP
model = AutoModelForCTC.from_pretrained(config.model_dir)
processor = AutoProcessor.from_pretrained(config.model_dir)

if config.wandb and is_main_process:
wandb_init(
project=config.wandb_project,
Expand All @@ -42,8 +51,6 @@ def finetune(config: DictConfig) -> None:
if "val" not in dataset and is_main_process:
logger.info("No validation set found. Disabling early stopping.")

breakpoint()

trainer = model_setup.load_trainer_class()(
model=model,
data_collator=model_setup.load_data_collator(),
Expand Down

0 comments on commit d0ce95c

Please sign in to comment.