Skip to content

Commit

Permalink
select device
Browse files Browse the repository at this point in the history
  • Loading branch information
wgifford committed Dec 10, 2024
1 parent 5330e1e commit c96905d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion services/finetuning/tsfmfinetuning/finetuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import Any, Dict, Tuple, Union

import pandas as pd
import torch
from fastapi import APIRouter, HTTPException
from starlette import status
from transformers import EarlyStoppingCallback, Trainer, TrainingArguments, set_seed
Expand Down Expand Up @@ -215,7 +216,7 @@ def _finetuning_common(
metric_for_best_model="eval_loss", # Metric to monitor for early stopping
greater_is_better=False, # For loss
label_names=["future_values"],
use_cpu=True, # only needed for testing on Mac :(
use_cpu=not torch.cuda.is_available(),
)

callbacks = []
Expand Down

0 comments on commit c96905d

Please sign in to comment.