File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ class Settings:
4949 def __new__ (cls ):
5050 if cls ._instance is None :
5151 cls ._instance = super ().__new__ (cls )
52- cls . _instance . lock = threading . Lock () # maintained here for assertions
52+ # No need for a lock since we're only updating main_thread_config in the main thread
5353 return cls ._instance
5454
5555 def __getattr__ (self , name ):
@@ -113,6 +113,10 @@ def context(self, **kwargs):
113113 finally :
114114 dspy_ctx_overrides .reset (token )
115115
116+ if threading .current_thread () is threading .main_thread ():
117+ global main_thread_config
118+ main_thread_config = dspy_ctx_overrides .get ()
119+
116120 def __repr__ (self ):
117121 overrides = dspy_ctx_overrides .get ()
118122 combined_config = {** main_thread_config , ** overrides }
You can’t perform that action at this time.
0 commit comments