Skip to content
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

Introduce v3 schema #39

Merged
merged 2 commits into from
Jul 22, 2024
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
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,8 @@ disable = [
[tool.pylint.reports]
reports = true
score = true

[tool.check-wheel-contents]
ignore = [
"W002", # ignore duplicate files
]
Empty file.
60 changes: 60 additions & 0 deletions src/instructlab/schema/v3/compositional_skills.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"title": "Compositional Skill",
"description": "A compositional skill.",
"type": "object",
"$ref": "./version.json",
"required": [
"created_by",
"task_description",
"seed_examples"
],
"unevaluatedProperties": false,
"properties": {
"created_by": {
"description": "The GitHub username of the contributor.",
"type": "string",
"minLength": 1
},
"task_description": {
"description": "A description of the task which is used in prompts to the teacher model during synthetic data generation. The description should be detailed and prescriptive to improve the teacher model's responses.",
"type": "string",
"minLength": 1,
"examples": [
"Extracting content from a financial report and providing it in bulleted format",
"Providing engaging explanations for common questions across diverse topics at a primary school level",
"Assume the roles of historical figures and provide engaging explanations for common questions across diverse topics"
]
},
"seed_examples": {
"description": "An array of seed examples for synthetic data generation.",
"type": "array",
"minItems": 5,
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"question",
"answer"
],
"unevaluatedProperties": false,
"properties": {
"context": {
"description": "Information that the teacher model is expected to take into account during processing. This is different from knowledge, where the model is expected to gain facts and background knowledge from the tuning process.",
"type": "string",
"minLength": 1
},
"question": {
"description": "A question used for synthetic data generation.",
"type": "string",
"minLength": 1
},
"answer": {
"description": "The desired response for the question.",
"type": "string",
"minLength": 1
}
}
}
}
}
}
127 changes: 127 additions & 0 deletions src/instructlab/schema/v3/knowledge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
"title": "Knowledge",
"description": "A knowledge skill.",
"type": "object",
"$ref": "./version.json",
"required": [
"created_by",
"domain",
"seed_examples",
"document",
"document_outline"
],
"unevaluatedProperties": false,
"properties": {
"created_by": {
"description": "The GitHub username of the contributor.",
"type": "string",
"minLength": 1
},
"domain": {
"description": "The knowledge domain which is used in prompts to the teacher model during synthetic data generation. The domain should be brief such as the title to a textbook chapter or section.",
"type": "string",
"minLength": 1,
"examples": [
"Chemistry",
"History",
"Pop culture"
]
},
"seed_examples": {
"description": "An array of seed examples for synthetic data generation.",
"type": "array",
"minItems": 5,
russellb marked this conversation as resolved.
Show resolved Hide resolved
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"context",
"questions_and_answers"
],
"unevaluatedProperties": false,
"properties": {
"context": {
"description": "Context from the document associated with this set of sample q&a pairs.",
"type": "string",
"minLength": 1
},
"questions_and_answers": {
russellb marked this conversation as resolved.
Show resolved Hide resolved
"type": "array",
"minItems": 3,
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"question",
"answer"
],
"properties": {
"question": {
"description": "A question used for synthetic data generation.",
russellb marked this conversation as resolved.
Show resolved Hide resolved
"type": "string",
"minLength": 1
},
"answer": {
"description": "The desired response for the question.",
"type": "string",
"minLength": 1
}
}
}
}
}
}
},
"document": {
"description": "The knowledge documents.",
"type": "object",
"required": [
"repo",
"commit",
"patterns"
],
"unevaluatedProperties": false,
"properties": {
"repo": {
"description": "The URL to a Git repository holding the knowledge documents.",
"type": "string",
"minLength": 1,
"examples": [
"https://github.com/instructlab/instructlab.git"
]
},
"commit": {
"description": "The commit in the Git repository containing the knowledge documents.",
"type": "string",
"minLength": 1,
"examples": [
"951999afdc59c46d325493568193b40bd5439c9e"
]
},
"patterns": {
"description": "An array of glob patterns of the knowledge documents in the Git repository.",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string",
"minLength": 1,
"examples": [
"*.md",
"folder/*.md",
"folder/knowledge_doc.md"
]
}
}
}
},
"document_outline": {
"description": "A brief summary of the document.",
"type": "string",
"minLength": 1,
"examples": [
"Overview of Human tonsils, describing their types, locations, structure, function, and clinical significance, with a specific focus on their role in the immune system and related health issues."
]
}
}
}
15 changes: 15 additions & 0 deletions src/instructlab/schema/v3/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"title": "Taxonomy Document Schema Version",
"type": "object",
"required": [
"version"
],
"properties": {
"version": {
"description": "The schema version of the taxonomy document.",
"type": "integer",
"$comment": "This value must match the number in the containing folder.",
"const": 3
}
}
}