Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

Update evaluate.py

bytesurfer3e40667bf221a
diff --git a/dspy/evaluate/evaluate.py b/dspy/evaluate/evaluate.py
index 476976b2a..ba832c560 100644
--- a/dspy/evaluate/evaluate.py
+++ b/dspy/evaluate/evaluate.py
@@ -3,7 +3,11 @@ import tqdm
import threading
import pandas as pd
-from IPython.display import display as ipython_display, HTML
+try:
+ from IPython.display import display as ipython_display, HTML
+except ImportError:
+ ipython_display = print
+ HTML = lambda x: x
from concurrent.futures import ThreadPoolExecutor, as_completed
from dsp.utils import EM
@@ -206,4 +210,4 @@ def configure_dataframe_display(df, metric_name):
})
# FIXME: TODO: The merge_dicts stuff above is way too quick and dirty.
-# TODO: the display_table can't handle False but can handle 0! Not sure how it works with True exactly, probably fails too.
\ No newline at end of file
+# TODO: the display_table can't handle False but can handle 0! Not sure how it works with True exactly, probably fails too.