Skip to content

Commit

Permalink
code contests
Browse files Browse the repository at this point in the history
  • Loading branch information
femto committed Jan 10, 2025
1 parent 53b4c3d commit 7602d41
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ async def solve_question(item):
Here is the function to implement:
""" + item['description'],
#entry_point="main", #used in extract_python
pre_processing="problem_reflect",
dataset="code_contests",
execution_config=load_execution_config(ensemble_logic_path),
metadata=metadata
Expand Down
6 changes: 6 additions & 0 deletions minion/main/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ async def _execute_test(self):
old_stdout = sys.stdout
sys.stdin = StringIO(input_data)
sys.stdout = StringIO()

#this stdin/stdout redirection will affect the whole python process, if this is a concern, use the following:
# from contextlib import redirect_stdout, redirect_stdin
# with StringIO() as new_stdout, StringIO(input_data) as new_stdin:
# with redirect_stdout(new_stdout), redirect_stdin(new_stdin):
# # Code here will have redirected I/O

try:
# Execute the main function
Expand Down
18 changes: 0 additions & 18 deletions minion/main/ensemble_logic.py

This file was deleted.

1 change: 1 addition & 0 deletions minion/main/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class Input(BaseModel):

# Execution state tracking
execution_state: ExecutionState = Field(default_factory=ExecutionState) # Current execution state
pre_processing: str = ""
post_processing: PostProcessingType = Field(
default=PostProcessingType.NONE,
description="Type of post-processing to apply"
Expand Down

0 comments on commit 7602d41

Please sign in to comment.