-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1126 from gpt-engineer-org/bench_config
Bench config
- Loading branch information
Showing
12 changed files
with
246 additions
and
51 deletions.
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.