Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Feature/change source #29

Merged
merged 8 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.yaml linguist-generated=true
*.tex linguist-generated=true
*.csv linguist-generated=true
*.json linguist-generated=true
Expand Down
3 changes: 2 additions & 1 deletion .github/scripts/check_prompt_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
if __name__ == "__main__":
data_config = DataConfig(
os.path.join(
get_data_config_dir(), "textbooks_are_all_you_need/main.yaml"
get_data_config_dir(),
"textbooks_are_all_you_need_basic_split/main.yaml",
)
)
prompt_generator = PromptGenerator(
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ poetry install -E <extra_name>
You can use SciPhi for dataset generation by executing the relevant `runner.py` file with various command-line arguments.

```bash
poetry run python sciphi/examples/data_generation/runner.py --provider_name=openai --model_name=gpt-4 --log_level=DEBUG --batch_size=1 --num_samples=1 --output_file_name=example_output.jsonl --example_config=textbooks_are_all_you_need
poetry run python sciphi/examples/basic_data_gen/runner.py --provider_name=openai --model_name=gpt-4 --log_level=DEBUG --batch_size=1 --num_samples=1 --output_file_name=example_output.jsonl --example_config=textbooks_are_all_you_need_basic_split
```

### Key Command-Line Arguments

- `--provider`: Which provider to use for completions (default: "openai").
- `--model_name`: The name of the model to load from the provider (default: "gpt-3.5-turbo").
- `--temperature`: Temperature parameter for the provided model (default: 0.7).
- `--example_config`: Which example configuration to use (default: "textbooks_are_all_you_need").
- `--example_config`: Which example configuration to use (default: "textbooks_are_all_you_need_basic_split").
- `--override_config_path`: Used to override the example configurations with custom config.
- `--num_samples`: Number of samples to generate (default: 1_024).
- `--output_dir`: File path to override the default output output file path with.
Expand All @@ -75,7 +75,7 @@ poetry run python sciphi/examples/data_generation/runner.py --provider_name=open
### Stock data configs

- `evol_instruct` - A config for replicating the EvolInstruct dataset
- `textbooks_are_all_you_need` - A config for replicating the Python textbook data from Textbooks Are All You Need [2]
- `textbooks_are_all_you_need_basic_split` - A config for replicating the Python textbook data from Textbooks Are All You Need [2]

### Example generated data
<img width="776" alt="Screenshot 2023-09-17 at 11 11 18 PM" src="https://github.com/emrgnt-cmplxty/SciPhi/assets/68796651/8f1ef11d-cd37-4fc7-a7a0-a1e0159ba4a3">
Expand Down
6 changes: 4 additions & 2 deletions sciphi/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def __init__(
self.config = yaml.safe_load(file)
self.main_path = os.path.dirname(main_config_path)
self.generator_mode: str = self.config.pop(generator_mode_field)

# Unpack the prompt config
self.prompt_templates: dict[str, int] = self.config.pop(
prompt_templates_field
Expand Down Expand Up @@ -76,7 +75,10 @@ def _load_configs(self) -> None:
entry = sub_config[key]

# Unroll dependencies (only single layers are supported now)
if key in self.prompt_template_input_dependencies:
if (
self.prompt_template_input_dependencies
and key in self.prompt_template_input_dependencies
):
entry = entry[
self.prompt_template_input_dependencies[key]
]
Expand Down
33,078 changes: 33,078 additions & 0 deletions sciphi/data/stock_config/textbooks_are_all_you_need_evol/evol_grade_school.yaml

Large diffs are not rendered by default.

33,784 changes: 33,784 additions & 0 deletions sciphi/data/stock_config/textbooks_are_all_you_need_evol/evol_seminar_i.yaml

Large diffs are not rendered by default.

107 changes: 107 additions & 0 deletions sciphi/data/stock_config/textbooks_are_all_you_need_evol/main.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
11 changes: 11 additions & 0 deletions sciphi/data/stock_raw/algorithms/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Algorithms by Jeff Erickson

This repository contains a copy of the book "Algorithms" by Jeff Erickson.

- **Author**: Jeff Erickson
- **Original Source**: [Jeff Erickson's Algorithms](https://jeffe.cs.illinois.edu/teaching/algorithms/)
- **License**: This work is licensed under the [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).

## Attribution

The book "Algorithms" is authored by Jeff Erickson and is redistributed here under the terms of the Creative Commons Attribution 4.0 International license. The original work can be found at [Jeff Erickson's Algorithms](https://jeffe.cs.illinois.edu/teaching/algorithms/).
54 changes: 0 additions & 54 deletions sciphi/data/stock_raw/learning_with_python/Makefile

This file was deleted.

Loading
Loading