DSPy: The framework for programming—not prompting—language models
Python
2 commits: 1 bad, 1 good (#569)
Isaac Miller70ef23d23f91
diff --git a/dspy/evaluate/evaluate.py b/dspy/evaluate/evaluate.pyindex b037153ad..4d1fd62f4 100644--- a/dspy/evaluate/evaluate.py+++ b/dspy/evaluate/evaluate.py@@ -1,17 +1,21 @@+import threadingimport types-import dsp-import tqdmimport pandas as pd+import tqdm-import threading+import dsptry:from IPython.display import HTMLfrom IPython.display import display as ipython_displayexcept ImportError:ipython_display = print- def HTML(x): return x++ def HTML(x):+ return x++from concurrent.futures import ThreadPoolExecutor, as_completedfrom dsp.evaluation.utils import *@@ -127,7 +131,8 @@ class Evaluate:try:prediction = program(**example.inputs())score = metric(- example, prediction+ example,+ prediction,) # FIXME: TODO: What's the right order? Maybe force name-based kwargs!# increment assert and suggest failures to program's attributes@@ -156,7 +161,10 @@ class Evaluate:wrapped_program, devset, display_progress)else:reordered_devset, ncorrect, ntotal = self._execute_multi_thread(- wrapped_program, devset, num_threads, display_progress+ wrapped_program,+ devset,+ num_threads,+ display_progress,)if return_outputs: # Handle the return_outputs logicresults = [(example, prediction, score)@@ -260,14 +268,14 @@ def configure_dataframe_display(df, metric_name):[{"selector": "th", "props": [("text-align", "left")]},{"selector": "td", "props": [("text-align", "left")]},- ]+ ],).set_properties(**{"text-align": "left","white-space": "pre-wrap","word-wrap": "break-word","max-width": "400px",- }+ },)