-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bench config #1126
Merged
+246
−51
Merged
Bench config #1126
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7e5a2f8
config succesfully imported
ATheorell b23ce56
WIP
ATheorell f0f7fd8
All bench suits running with config file options
ATheorell d7aec6b
Simplified benchconfig significantly
ATheorell d446900
ruff fix
ATheorell f4aa2d1
Fix pytest mark warning
ATheorell dca2dc0
added newline at the end of pyproject file
ATheorell 3542d17
FIx posixpath iteration bug (occurs when bench is installed)
ATheorell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
from dataclasses import dataclass, field | ||
from pathlib import Path | ||
|
||
from gpt_engineer.core.project_config import read_config | ||
|
||
|
||
@dataclass | ||
class AppsConfig: | ||
active: bool | None = True | ||
test_start_index: int | None = 0 | ||
test_end_index: int | None = 1 | ||
train_start_index: int | None = 0 | ||
train_end_index: int | None = 0 | ||
|
||
|
||
@dataclass | ||
class MbppConfig: | ||
active: bool | None = True | ||
test_len: int | None = 1 | ||
train_len: int | None = 0 | ||
|
||
|
||
@dataclass | ||
class GptmeConfig: | ||
active: bool | None = True | ||
|
||
|
||
@dataclass | ||
class GptengConfig: | ||
active: bool | None = True | ||
|
||
|
||
@dataclass | ||
class BenchConfig: | ||
"""Configuration for the GPT Engineer CLI and gptengineer.app via `gpt-engineer.toml`.""" | ||
|
||
apps: AppsConfig = field(default_factory=AppsConfig) | ||
mbpp: MbppConfig = field(default_factory=MbppConfig) | ||
gptme: GptmeConfig = field(default_factory=GptmeConfig) | ||
gpteng: GptengConfig = field(default_factory=GptengConfig) | ||
|
||
@classmethod | ||
def from_toml(cls, config_file: Path | str): | ||
if isinstance(config_file, str): | ||
config_file = Path(config_file) | ||
config_dict = read_config(config_file) | ||
return cls.from_dict(config_dict) | ||
|
||
@classmethod | ||
def from_dict(cls, config_dict: dict): | ||
return cls( | ||
apps=AppsConfig(**config_dict.get("apps", {})), | ||
mbpp=MbppConfig(**config_dict.get("mbpp", {})), | ||
gptme=GptmeConfig(**config_dict.get("gptme", {})), | ||
gpteng=GptengConfig(**config_dict.get("gpteng", {})), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# For apps, the maximal range is 0:5000 for both train and test | ||
[apps] | ||
active = true | ||
test_start_index = 0 | ||
test_end_index = 2 | ||
train_start_index = 0 | ||
train_end_index = 2 | ||
|
||
# For mbpp, the maximal range is 0:47 | ||
[mbpp] | ||
active = true | ||
test_len = 2 | ||
train_len = 2 | ||
|
||
[gpteng] | ||
active = true | ||
|
||
[gptme] | ||
active = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
from_toml
method in theBenchConfig
class does not seem to handle the case where the providedconfig_file
does not exist or is not a valid TOML file. This could lead to unhandled exceptions if the method is called with an invalid file path. Consider adding error handling to this method to provide a more informative error message in such cases.