Skip to content

Commit c28f939

Browse files
committed
Fix: add import error handling for dspy module
1 parent 1fdb218 commit c28f939

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

autointent/generation/utterances/evolution/dspy_evolver.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
from collections import Counter
77
from pathlib import Path
88

9-
import dspy
9+
try:
10+
import dspy
11+
except ImportError:
12+
raise ImportError("dspy is not installed. Please install it with `pip install dspy` or `pip install autointent[dspy]`.")
1013
from datasets import Dataset as HFDataset
1114
from datasets import concatenate_datasets
1215
from dspy.evaluate.auto_evaluation import f1_score

0 commit comments

Comments
 (0)