We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3ff898 commit 1ccbcf1Copy full SHA for 1ccbcf1
src/chronos/chronos2/pipeline.py
@@ -162,10 +162,10 @@ def fit(
162
import torch.cuda
163
from transformers.training_args import TrainingArguments
164
165
- try:
166
- from peft import LoraConfig, get_peft_model
167
- except:
168
- if finetune_mode == "lora":
+ if finetune_mode == "lora":
+ if is_peft_available():
+ from peft import LoraConfig, get_peft_model
+ else:
169
warnings.warn(
170
"`peft` is required for `finetune_mode='lora'`. Please install it with `pip install peft`. Falling back to `finetune_mode='full'`."
171
)
0 commit comments