mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-27 15:37:44 +00:00
fix: fix some minor bugs in qlib scenario (#817)
* fix some bugs * fix a bug * fix a bug in qlib frontend * fix ci * fic ci * fix qlib Dockerfile
This commit is contained in:
@@ -114,21 +114,35 @@ class CoSTEERSingleFeedbackDeprecated(CoSTEERSingleFeedback):
|
||||
# Instead, we should create subclass for it.
|
||||
self.shape_feedback = shape_feedback # Not general enough. So
|
||||
|
||||
# TODO: @property
|
||||
@property
|
||||
def execution(self):
|
||||
return self.execution_feedback
|
||||
|
||||
@execution.setter
|
||||
def execution(self, value):
|
||||
self.execution_feedback = value
|
||||
|
||||
@property
|
||||
def return_checking(self):
|
||||
if self.value_generated_flag:
|
||||
return f"value feedback: {self.value_feedback}\n\nshape feedback: {self.shape_feedback}"
|
||||
return None
|
||||
|
||||
@return_checking.setter
|
||||
def return_checking(self, value):
|
||||
# Since return_checking is derived from value_feedback and shape_feedback,
|
||||
# we don't need to do anything here
|
||||
self.value_feedback = value
|
||||
self.shape_feedback = value
|
||||
|
||||
@property
|
||||
def code(self):
|
||||
return self.code_feedback
|
||||
|
||||
@code.setter
|
||||
def code(self, value):
|
||||
self.code_feedback = value
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"""------------------Execution Feedback------------------
|
||||
{self.execution_feedback if self.execution_feedback is not None else 'No execution feedback'}
|
||||
|
||||
@@ -26,6 +26,7 @@ class FactorCoSTEER(CoSTEER):
|
||||
try:
|
||||
exp = super().develop(exp)
|
||||
finally:
|
||||
es = self.evolve_agent.evolving_trace[-1]
|
||||
exp.prop_dev_feedback = es.feedback
|
||||
if hasattr(self, "evolve_agent") and self.evolve_agent.evolving_trace:
|
||||
es = self.evolve_agent.evolving_trace[-1]
|
||||
exp.prop_dev_feedback = es.feedback
|
||||
return exp
|
||||
|
||||
@@ -210,10 +210,7 @@ def get_msgs_until(end_func: Callable[[Message], bool] = lambda _: True):
|
||||
msg.content = [i for i in msg.content if i]
|
||||
if "evolving feedback" in tags:
|
||||
total_len = len(msg.content)
|
||||
msg.content = [i for i in msg.content if i]
|
||||
none_num = total_len - len(msg.content)
|
||||
if len(msg.content) != len(state.msgs[state.lround]["d.evolving code"][-1].content):
|
||||
st.toast(":red[**Evolving Feedback Length Error!**]", icon="‼️")
|
||||
right_num = 0
|
||||
for wsf in msg.content:
|
||||
if wsf.final_decision:
|
||||
|
||||
@@ -9,11 +9,11 @@ RUN apt-get clean && apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN git clone --depth=100 https://github.com/microsoft/qlib.git
|
||||
RUN git clone https://github.com/microsoft/qlib.git
|
||||
|
||||
WORKDIR /workspace/qlib
|
||||
|
||||
RUN git reset e7a1b5ea1ff4412792eeb606a639e0dde422053a --hard
|
||||
RUN git fetch && git reset dbde1a109fb53e742a4dd210552ebf943576add9 --hard
|
||||
|
||||
RUN python -m pip install --upgrade cython
|
||||
RUN python -m pip install -e .
|
||||
|
||||
@@ -443,6 +443,7 @@ class QlibDockerConf(DockerConf):
|
||||
extra_volumes: dict = {str(Path("~/.qlib/").expanduser().resolve().absolute()): "/root/.qlib/"}
|
||||
shm_size: str | None = "16g"
|
||||
enable_gpu: bool = True
|
||||
enable_cache: bool = False
|
||||
|
||||
|
||||
class DMDockerConf(DockerConf):
|
||||
|
||||
Reference in New Issue
Block a user