Skip to content

Commit

Permalink
Merge pull request #23 from JetBrains-Research/6th-mode
Browse files Browse the repository at this point in the history
fixes to several_modes
  • Loading branch information
alex28sh authored Jan 9, 2025
2 parents 6c678ac + 6d1afb4 commit 32122ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
5 changes: 0 additions & 5 deletions verified_cogen/llm/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ def _request(
prompt = ChatPrompt().add_system(self.system_prompt)
current_prompt_user = 0
current_response = 0
print(len(self.user_prompts), len(self.responses))
# for p in self.user_prompts:
# print("P:" + p[:min(len(p), 20)])
# for response in self.responses:
# print("R:" + response[:min(len(response), 20)])
while current_prompt_user < len(self.user_prompts) or current_response < len(
self.responses
):
Expand Down
16 changes: 11 additions & 5 deletions verified_cogen/several_modes/several_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,28 @@ def main():
register_basic_languages(with_removed=all_removed)

logger.info(mode)
log_tries_mode = log_tries_dir / mode if log_tries_dir is not None else None
log_tries_mode = (
log_tries_dir / f"{idx}_{mode}" if log_tries_dir is not None else None
)
if log_tries_mode is not None:
log_tries_mode.mkdir(exist_ok=True)

json_avg_results = results_directory / f"tries_{directory.name}_{mode}_avg.json"
json_avg_results = (
results_directory / f"tries_{directory.name}_{idx}_{mode}_avg.json"
)
with open(json_avg_results, "w") as f:
json.dump({}, f)
results_avg: Dict[int, float] = dict([(i, 0) for i in range(args.runs + 1)])
results_avg: Dict[int, float] = dict([(i, 0) for i in range(args.tries + 1)])

for run in range(args.runs):
logger.info(f"Run {run}")

history_dir = results_directory / f"history_{directory.name}_{mode}_{run}"
history_dir = (
results_directory / f"history_{directory.name}_{idx}_{mode}_{run}"
)
history_dir.mkdir(exist_ok=True)
json_results = (
results_directory / f"tries_{directory.name}_{mode}_{run}.json"
results_directory / f"tries_{directory.name}_{idx}_{mode}_{run}.json"
)
if not json_results.exists():
with open(json_results, "w") as f:
Expand Down

0 comments on commit 32122ab

Please sign in to comment.