Skip to content

Commit

Permalink
feat: setup results branch and folder to pull result files
Browse files Browse the repository at this point in the history
  • Loading branch information
ganler committed Apr 20, 2024
1 parent cece95c commit 8b3d72c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
13 changes: 7 additions & 6 deletions repoqa/search_needle_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def evaluate_model(
result_dir: str = "results",
languages: List[str] = None,
caching: bool = False, # if enabled, will cache the tasks which can be used to resume
system_message: str = "You are a helpful assistant good at code understanding.",
system_message: str = None,
):
if backend is None:
if base_url is not None:
Expand All @@ -178,7 +178,12 @@ def evaluate_model(

# makedir if not exists
os.makedirs(result_dir, exist_ok=True)
result_file = os.path.join(result_dir, f"{model.replace('/', '_slash_')}.jsonl")
context_size_dir = os.path.join(result_dir, f"ntoken_{code_context_size}")
os.makedirs(context_size_dir, exist_ok=True)
result_file = os.path.join(
context_size_dir,
f"{model.replace('/', '_slash_')}.jsonl",
)

# resume from result_file
if os.path.exists(result_file):
Expand Down Expand Up @@ -303,10 +308,6 @@ def evaluate_model(
max_model_len=int(code_context_size * 1.25), # Magic number
)

if model == "mistralai/Mixtral-8x7B-Instruct-v0.1":
system_message = None
print(f"Warning: {model} does not support system message")

if not system_message:
print("🔥 System message is disabled")
system_message = None
Expand Down
1 change: 1 addition & 0 deletions results/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.zip
7 changes: 7 additions & 0 deletions results/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Pull evaluated results

```bash
gh release download dev-results --pattern "*.zip" --clobber
# unzip all zip files
unzip "*.zip"
```

0 comments on commit 8b3d72c

Please sign in to comment.