Skip to content

Commit

Permalink
fix settings contextmanager
Browse files Browse the repository at this point in the history
  • Loading branch information
okhat committed Nov 24, 2024
1 parent ff6d77f commit 2aa6f01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dsp/utils/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def config(self):
def configure(self, return_token=False, **kwargs):
global main_thread_config
overrides = dspy_ctx_overrides.get()
new_overrides = dotdict({**main_thread_config, **overrides, **kwargs})
new_overrides = dotdict({**copy.deepcopy(DEFAULT_CONFIG), **main_thread_config, **overrides, **kwargs})
token = dspy_ctx_overrides.set(new_overrides)

# Update main_thread_config, in the main thread only
Expand All @@ -121,7 +121,7 @@ def context(self, **kwargs):

if threading.current_thread() is threading.main_thread():
global main_thread_config
main_thread_config = dspy_ctx_overrides.get()
main_thread_config = dotdict({**copy.deepcopy(DEFAULT_CONFIG), **dspy_ctx_overrides.get()})

def __repr__(self):
overrides = dspy_ctx_overrides.get()
Expand Down

0 comments on commit 2aa6f01

Please sign in to comment.