Skip to content

armgit / dspy

Public Imported from GitHub
0

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

Python

new threads start from parent thread config

Arnav Singhvi9868fcd32b38
diff --git a/dsp/utils/settings.py b/dsp/utils/settings.py
index 290f364b5..f56bafbb5 100644
--- a/dsp/utils/settings.py
+++ b/dsp/utils/settings.py
@@ -41,7 +41,7 @@ class Settings(object):
def config(self):
thread_id = threading.get_ident()
if thread_id not in self.stack_by_thread:
- self.stack_by_thread[thread_id] = [self.main_stack[0].copy()]
+ self.stack_by_thread[thread_id] = [self.main_stack[-1].copy()]
return self.stack_by_thread[thread_id][-1]
def __getattr__(self, name):
@@ -56,7 +56,7 @@ class Settings(object):
def __append(self, config):
thread_id = threading.get_ident()
if thread_id not in self.stack_by_thread:
- self.stack_by_thread[thread_id] = [self.main_stack[0].copy()]
+ self.stack_by_thread[thread_id] = [self.main_stack[-1].copy()]
self.stack_by_thread[thread_id].append(config)
def __pop(self):