Skip to content

Commit

Permalink
Merge pull request #46 from russellb/new-cli-integration
Browse files Browse the repository at this point in the history
Initial CLI integration with new SDG interfaces
  • Loading branch information
russellb authored Jun 28, 2024
2 parents 6c9d69a + 31ecfda commit 1f71fb6
Show file tree
Hide file tree
Showing 15 changed files with 1,066 additions and 905 deletions.
4 changes: 2 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,9 @@ disable=raw-checker-failed,
logging-too-many-args,
attribute-defined-outside-init,
abstract-method,
pointless-statement,
wrong-import-order,
line-too-long
line-too-long,
logging-fstring-interpolation

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ known-local-folder = ["tuning"]
disable_error_code = ["import-not-found", "import-untyped"]
exclude = [
"^src/instructlab/sdg/generate_data\\.py$",
"^src/instructlab/sdg/utils\\.py$",
"^src/instructlab/sdg/utils/taxonomy\\.py$",
"^src/instructlab/sdg/default_flows\\.py$",
"^src/instructlab/sdg/llmblock\\.py$",
"^src/instructlab/sdg/utilblocks\\.py$",
Expand Down
34 changes: 34 additions & 0 deletions src/instructlab/sdg/configs/knowledge/simple_generate_qa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
system: You are a very knowledgeable AI Assistant that will faithfully assist the user with their task.

introduction: Develop a series of educational question and answer pairs from a chapter in a {domain} textbook.

principles: |
Here are the requirements:
1. Try not to repeat the verb for each instruction to maximize diversity.
2. The language used for the instruction also should be diverse. For example, you should combine questions with imperative instructions.
3. The type of instructions should be similar to provided examples. The generated instruction and the output should be grounded in the provided document.
4. A GPT language model should be able to complete the instruction. For example, do not ask the assistant to create any visual or audio output. For another example, do not ask the assistant to wake you up at 5pm or set a reminder because it cannot perform any action.
5. The instructions should be in English.
6. The instructions should be 1 to 2 sentences long. Either an imperative sentence or a question is permitted.
7. The output should be an appropriate response to the input and the instruction. Long outputs are preferable.

examples: |
Here are some examples to help you understand the type of questions that are asked for this document:
{question_1}
{response_1}
{question_2}
{response_2}
{question_3}
{response_3}
Here is the document:
{document}
generation: |
Provide a single question and answer pair based on the document.
start_tags: [""]
end_tags: [""]
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
system: You are a very knowledgeable AI Assistant that will faithfully assist the user with their task.

introduction: Develop a series of question and answer pairs to perform a task.

principles: |
Here are the requirements:
1. Try not to repeat the verb for each instruction to maximize diversity.
2. The language used for the instruction also should be diverse. For example, you should combine questions with imperative instructions.
3. The type of instructions should be similar to provided examples. The generated instruction and the output should be grounded in the provided document.
4. A GPT language model should be able to complete the instruction. For example, do not ask the assistant to create any visual or audio output. For another example, do not ask the assistant to wake you up at 5pm or set a reminder because it cannot perform any action.
5. The instructions should be in English.
6. The instructions should be 1 to 2 sentences long. Either an imperative sentence or a question is permitted.
7. The output should be an appropriate response to the input and the instruction. Long outputs are preferable.

examples: |
The task is {task_description}.
Here are some examples to help you understand the type of questions that are asked for:
{question_1}
{response_1}
{question_2}
{response_2}
{question_3}
{response_3}
generation: |
Provide a single question and answer pair based on the examples.
start_tags: [""]
end_tags: [""]
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
system: You are a very knowledgeable AI Assistant that will faithfully assist the user with their task.

introduction: Develop a series of question and answer pairs to perform a task.

principles: |
Here are the requirements:
1. Try not to repeat the verb for each instruction to maximize diversity.
2. The language used for the instruction also should be diverse. For example, you should combine questions with imperative instructions.
3. The type of instructions should be similar to provided examples. The generated instruction and the output should be grounded in the provided document.
4. A GPT language model should be able to complete the instruction. For example, do not ask the assistant to create any visual or audio output. For another example, do not ask the assistant to wake you up at 5pm or set a reminder because it cannot perform any action.
5. The instructions should be in English.
6. The instructions should be 1 to 2 sentences long. Either an imperative sentence or a question is permitted.
7. The output should be an appropriate response to the input and the instruction. Long outputs are preferable.

examples: |
The task is {task_description}.
Here is some context for the example questions:
{context}
Here are some examples to help you understand the type of questions that are asked for:
{question_1}
{response_1}
{question_2}
{response_2}
{question_3}
{response_3}
generation: |
Provide a single question and answer pair based on the examples.
start_tags: [""]
end_tags: [""]
Loading

0 comments on commit 1f71fb6

Please sign in to comment.