sdg-hub 0.1.3__tar.gz → 0.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sdg_hub-0.1.3/src/sdg_hub.egg-info → sdg_hub-0.1.4}/PKG-INFO +1 -1
- sdg_hub-0.1.4/examples/knowledge_tuning/README.md +115 -0
- sdg_hub-0.1.4/examples/knowledge_tuning/instructlab/README.md +110 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/instructlab/knowledge_generation_and_mixing.ipynb +2 -3
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_utils.py +39 -14
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/_version.py +2 -2
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/flows/generation/knowledge/synth_knowledge1.5.yaml +9 -21
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/prompts.py +11 -5
- {sdg_hub-0.1.3 → sdg_hub-0.1.4/src/sdg_hub.egg-info}/PKG-INFO +1 -1
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub.egg-info/SOURCES.txt +2 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.github/actionlint.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.github/actions/free-disk-space/action.yml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.github/dependabot.yml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.github/mergify.yml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.github/workflows/actionlint.dockerfile +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.github/workflows/actionlint.yml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.github/workflows/docs.yml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.github/workflows/e2e.yml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.github/workflows/lint.yml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.github/workflows/matchers/actionlint.json +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.github/workflows/matchers/pylint.json +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.github/workflows/pypi.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.github/workflows/test.yml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.gitignore +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.isort.cfg +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.markdownlint-cli2.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.pre-commit-config.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/.pylintrc +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/CLAUDE.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/CONTRIBUTING.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/LICENSE +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/MANIFEST.in +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/Makefile +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/README.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/assets/imgs/IL_skills_pipeline.png +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/assets/imgs/fig-workflow.png +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/assets/imgs/instructlab-banner.png +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/assets/imgs/overview.png +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/docs/.nojekyll +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/docs/README.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/docs/_coverpage.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/docs/_navbar.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/docs/_sidebar.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/docs/architecture.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/docs/blocks.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/docs/changelog.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/docs/configuration.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/docs/development.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/docs/examples.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/docs/index.html +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/docs/installation.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/docs/prompts.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/docs/quick-start.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/docs/web-interface.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/data-generation-with-llama-70b/data-generation-with-llama-70b.ipynb +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/data-generation-with-llama-70b/synth_knowledge1.5_llama3.3.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/instructlab/docparser.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/instructlab/docparser_v2.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/instructlab/document_collection/ibm-annual-report/ibm-annual-report-2024.json +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/instructlab/document_collection/ibm-annual-report/ibm-annual-report-2024.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/instructlab/document_collection/ibm-annual-report/ibm-annual-report-2024.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/instructlab/document_collection/ibm-annual-report/qna.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/instructlab/document_pre_processing.ipynb +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/README.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/assets/customized_nano_quality_results.png +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/blocks/blocks.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/flows/synth_knowledge1.5_nemotron_super_49b.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/flows/synth_knowledge_reasoning_nemotron_super_49b.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/flows/synth_knowledge_reasoning_nemotron_super_49b_rewrite_with_diversity.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/flows/synth_knowledge_reasoning_nemotron_super_49b_summary_diversity.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/flows/synth_knowledge_reasoning_nemotron_super_49b_summary_diversity_cot.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/generate.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/prompts/generate_answers.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/prompts/generate_answers_cot.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/prompts/generate_doc_rewrite_inst.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/prompts/generate_document_rewrite.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/prompts/generate_questions.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/prompts/generate_questions_responses.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/prompts/generate_summary.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/prompts/generate_summary_inst.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/reasoning_sdg.ipynb +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/reasoning_sdg_data_mixing.ipynb +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/reasoning_sdg_financebench.ipynb +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/utils.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/README.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/annotation_classification.ipynb +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/blocks/__init__.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/blocks/add_question.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/blocks/docling_parse_pdf.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/blocks/json_format.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/flows/detailed_annotation.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/flows/grounded_summary_extraction.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/flows/simple_annotation.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/flows/unstructured_to_structured.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/prompts/keywords.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/prompts/named_entities.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/prompts/sentiment.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/prompts/summary.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/09b5b62d328d3d0719b6825357fdfb48.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/0d631e444d1c22f0be99a69f5deaff94.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/1270f7f67f406b52a2ee86584b452bff.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/14f3d2486b21e639a953afb7ad03d90c.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/1689b94530eca82b7758c86b4cf3125f.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/171fd9df333ddd814c764843ed624121.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/1949bd0c9c4c23d495d880c4c552bfe1.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/2b626b620ef42f716c6028c74ee4187b.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/3877b1983229ec488c6349a188bccf92.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/3bc6d3e1c0a117340d288c289bf7f679.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/3e714a49937be1672aa48244ba7254ce.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/6064088db0200b32f3f3e848047c5ab6.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/73c60e60043b8775dac929320839a8c6.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/77423f08f0208d476dea73c639f6293a.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/78cf0d3e40caba622d8914916f0f9146.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/7a29e2dcd505f944b16d1e3173cb1c01.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/8c1b4f4af2af2847a240041390e31399.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/8cd753ed00aeee0ed32d03823eef3f7e.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/a24a661c2eb55542903c72391ec09f9b.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/b3d7bc295d09d9927e465213612c0192.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/b7050f62f52a3d2803beea21404f7af6.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/b9b40b0c1e92fb226067bdceacbdab5c.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/c20824ea6f927fe380f48a904cf4821b.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/c2bad61ce58687fad602549f6048004b.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/c47a92e006b54d014a79b447528c55a7.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/da879f8ea1c23aa6565cccaacac271fc.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/e52e6870e8a04339ef969543fc0f0329.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/ecd8e1f1c0fa27dfdd24b358cb65012f.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/f28832481653818f8062a497655fb09e.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/ff898f396d49760343d08575ea773b54.pdf +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts.jsonl +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/table_manipulation_qna.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/seed_data/unstructured_to_structured_qna.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/structured_summary.ipynb +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/table_manipulation.ipynb +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/skills_tuning/instructlab/unstructured_to_structured.ipynb +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/pyproject.toml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/scripts/__init__.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/scripts/ruff.sh +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/setup.cfg +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/__init__.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/blocks/__init__.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/blocks/block.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/blocks/llmblock.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/blocks/openaichatblock.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/blocks/utilblocks.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/checkpointer.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/__init__.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/annotations/__init__.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/annotations/cot_reflection.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/annotations/detailed_annotations.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/annotations/detailed_description.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/annotations/detailed_description_icl.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/annotations/simple_annotations.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/knowledge/__init__.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/knowledge/atomic_facts.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/knowledge/auxilary_instructions.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/knowledge/detailed_summary.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/knowledge/evaluate_faithfulness.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/knowledge/evaluate_question.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/knowledge/evaluate_relevancy.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/knowledge/extractive_summary.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/knowledge/generate_code_questions_responses.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/knowledge/generate_questions.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/knowledge/generate_questions_responses.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/knowledge/generate_responses.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/knowledge/mcq_generation.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/knowledge/router.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/knowledge/simple_generate_qa.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/reasoning/__init__.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/reasoning/dynamic_cot.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/__init__.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/analyzer.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/annotation.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/contexts.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/critic.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/evaluate_freeform_pair.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/evaluate_freeform_questions.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/evaluate_grounded_pair.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/evaluate_grounded_questions.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/freeform_questions.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/freeform_responses.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/grounded_questions.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/grounded_responses.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/icl_examples/STEM.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/icl_examples/__init__.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/icl_examples/coding.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/icl_examples/extraction.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/icl_examples/humanities.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/icl_examples/math.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/icl_examples/reasoning.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/icl_examples/roleplay.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/icl_examples/writing.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/judge.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/planner.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/respond.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/revised_responder.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/router.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/simple_generate_qa_freeform.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/configs/skills/simple_generate_qa_grounded.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/flow.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/flow_runner.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/flows/generation/knowledge/mmlu_bench.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/flows/generation/knowledge/simple_knowledge.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/flows/generation/knowledge/synth_knowledge.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/flows/generation/skills/improve_responses.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/flows/generation/skills/simple_freeform_skill.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/flows/generation/skills/simple_grounded_skill.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/flows/generation/skills/synth_grounded_skills.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/flows/generation/skills/synth_skills.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/logger_config.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/pipeline.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/py.typed +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/registry.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/sdg.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/utils/__init__.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/utils/config_validation.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/utils/datautils.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/utils/error_handling.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/utils/path_resolution.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/utils/validation_result.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub.egg-info/dependency_links.txt +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub.egg-info/requires.txt +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub.egg-info/top_level.txt +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/__init__.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/blocks/test_llmblock.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/blocks/test_openaichatblock.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/blocks/testdata/test_config.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/blocks/utilblocks/test_combinecolumns.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/blocks/utilblocks/test_duplicatecolumnsblock.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/blocks/utilblocks/test_filterblock.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/blocks/utilblocks/test_flattenblock.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/blocks/utilblocks/test_renameblock.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/blocks/utilblocks/test_samplepopulatorblock.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/blocks/utilblocks/test_selectorblock.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/blocks/utilblocks/test_settomajority.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/flows/test_flow.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/flows/test_flow_column_validation.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/flows/test_flow_path.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/flows/test_flow_validation.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/flows/testdata/test_config_1.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/flows/testdata/test_flow_1.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/flows/testdata/test_flow_2.yaml +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/test_checkpointer.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/test_flowrunner.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/test_pipeline.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/test_sdg.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/utils/test_config_validation.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/utils/test_error_handling.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tests/utils/test_path_resolution.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/tox.ini +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/web_interface/README.md +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/web_interface/app.py +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/web_interface/static/css/style.css +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/web_interface/static/js/app.js +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/web_interface/templates/index.html +0 -0
- {sdg_hub-0.1.3 → sdg_hub-0.1.4}/web_interface/test_block_types.py +0 -0
@@ -0,0 +1,115 @@
|
|
1
|
+
# Synthetic Data Generation for Knowledge Tuning
|
2
|
+
|
3
|
+
## What is Knowledge Tuning?
|
4
|
+
|
5
|
+
**Knowledge tuning** is the process of adapting a large language model (LLM) to new factual content by training it on specific documents. The goal is to enable the model to **recall and reason over document-grounded information** when performing downstream tasks such as:
|
6
|
+
|
7
|
+
* Question Answering
|
8
|
+
* Summarization
|
9
|
+
* Entity Extraction
|
10
|
+
* Other document-specific reasoning tasks
|
11
|
+
|
12
|
+
This adaptation can be used:
|
13
|
+
|
14
|
+
* As a **standalone fine-tuned model**, or
|
15
|
+
* As part of a **Retrieval-Augmented Generation (RAG)** pipeline to enhance factual accuracy and contextuality.
|
16
|
+
|
17
|
+
---
|
18
|
+
|
19
|
+
### Setup Instructions
|
20
|
+
|
21
|
+
#### Install sdg-hub
|
22
|
+
|
23
|
+
```bash
|
24
|
+
pip install sdg-hub==0.1.0a4
|
25
|
+
```
|
26
|
+
|
27
|
+
#### Install with optional dependencies
|
28
|
+
|
29
|
+
If you want to use the vLLM server, you can install it with the following command:
|
30
|
+
|
31
|
+
```bash
|
32
|
+
pip install sdg-hub[vllm]
|
33
|
+
```
|
34
|
+
|
35
|
+
In order to use docling, you need to install it with the following command:
|
36
|
+
|
37
|
+
```bash
|
38
|
+
pip install sdg-hub[examples]
|
39
|
+
```
|
40
|
+
|
41
|
+
### Serving the Teacher Model
|
42
|
+
|
43
|
+
#### vLLM Server
|
44
|
+
|
45
|
+
Launch the vLLM server with the following command:
|
46
|
+
|
47
|
+
```bash
|
48
|
+
vllm serve meta-llama/Llama-3.3-70B-Instruct --tensor-parallel-size 4
|
49
|
+
```
|
50
|
+
|
51
|
+
## Repository Structure
|
52
|
+
|
53
|
+
This repository demonstrates how to generate synthetic data for knowledge tuning using different approaches:
|
54
|
+
|
55
|
+
### Examples
|
56
|
+
|
57
|
+
1. [`instructlab/`](instructlab/):
|
58
|
+
Implements knowledge tuning using the **InstructLab** pipeline, which supports a two-phase approach:
|
59
|
+
|
60
|
+
* Phase 1: Knowledge tuning via synthetic QAs
|
61
|
+
* Phase 2: Instruction tuning to generalize reasoning skills
|
62
|
+
|
63
|
+
2. [`knowledge_tuning_with_reasoning_model/`](knowledge_tuning_with_reasoning_model/):
|
64
|
+
Uses **Nemotron Super** as the teacher model to generate reasoning-focused synthetic data grounded in document content. We also show how to edit the knowledge pipeline to introduce new types of summaries
|
65
|
+
|
66
|
+
Each example includes:
|
67
|
+
|
68
|
+
* Source document processing
|
69
|
+
* QA generation with a teacher model
|
70
|
+
* Filtering and validation logic
|
71
|
+
* Dataset formatting for fine-tuning
|
72
|
+
|
73
|
+
3. [`translation_example`](translation_example/):
|
74
|
+
Implements a translation block to translate article into a target language for generating knowledge QA. The example scripts show how to translate Kannada Wikipedia article into English and generate synthetic QA to train a model.
|
75
|
+
---
|
76
|
+
|
77
|
+
## Data Post-Processing
|
78
|
+
|
79
|
+
Once synthetic QA data is generated, you’ll need to prepare it for training:
|
80
|
+
|
81
|
+
### Key Practices
|
82
|
+
|
83
|
+
* Append source document content to the generated QA to improve memorization and coverage.
|
84
|
+
* During training, backpropagate on both the **prompt** (document + question) and the **response** (answer).
|
85
|
+
* For `instructlab.training`, you can use the `unmask` field to enable pretraining-style loss computation over the full prompt-response.
|
86
|
+
|
87
|
+
### Creating QA dataset
|
88
|
+
|
89
|
+
* You can use below function to transform the generated dataset into Prompt + Response pair for training in messages format.
|
90
|
+
* You can control various parameters like appending document to question, adding document outline to document etc.
|
91
|
+
```python
|
92
|
+
from knowledge_utils import generate_knowledge_qa_dataset
|
93
|
+
|
94
|
+
knowl_train = generate_knowledge_qa_dataset(
|
95
|
+
generated_dataset=generated_data,
|
96
|
+
keep_context_separate=False,
|
97
|
+
keep_document_outline=True,
|
98
|
+
keep_columns=['document', 'document_outline', 'raw_document']
|
99
|
+
)
|
100
|
+
```
|
101
|
+
* `keep_context_separate=False`: Includes the document in the prompt
|
102
|
+
* `keep_document_outline=True`: Adds structure to the prompt using outline
|
103
|
+
* `keep_columns`: Retains metadata for record-keeping (not used in training)
|
104
|
+
|
105
|
+
|
106
|
+
### Workflow: InstructLab (Knowledge + RAFT)
|
107
|
+
You can find steps for data post-processing [here](instructlab/README.md#data-post-processing)
|
108
|
+
|
109
|
+
### Workflow: Fine-tuning Instruct Model
|
110
|
+
|
111
|
+
* You can simply take the generated data and continue instruction tuning an existing instruct model (e.g. Qwen 2.5 8B instruct, LLama 3.3 8B/70B etc.)
|
112
|
+
* Simply follow [Creating QA dataset](#creating-qa-dataset) section for creating the training data.
|
113
|
+
* Note: The model might suffer catastrophic forgetting and might need a replay buffer of instruction data. Or you might need to explore alternate methods like Parameter efficient fine-tuning.
|
114
|
+
|
115
|
+
|
@@ -0,0 +1,110 @@
|
|
1
|
+
# InstructLab: Synthetic Data Generation for Knowledge Tuning
|
2
|
+

|
3
|
+
|
4
|
+
The provided notebooks show a sdg_hub pipeline for generating high-quality synthetic data from your documents. By following the methodology of the **LAB (Large-scale Alignment for Chatbots)** framework, as detailed in our [research paper](https://arxiv.org/pdf/2403.01081), you can effectively tune language models to master the knowledge contained within your specific-domain documentation.
|
5
|
+
|
6
|
+
## How It Works: A Three-Phase Pipeline
|
7
|
+
|
8
|
+
Our data generation process is designed to operate in three distinct phases, ensuring the creation of a robust and reliable dataset for model training.
|
9
|
+
|
10
|
+
### 1\. Document Summarization
|
11
|
+
|
12
|
+
To kickstart the process, we generate three unique summaries of your source documents. This multi-faceted approach helps the model to thoroughly memorize and recall the key information. The summaries include:
|
13
|
+
|
14
|
+
* **Detailed Summaries:** Comprehensive overviews of the content.
|
15
|
+
* **Extractive Summaries:** Key sentences and passages pulled directly from the text.
|
16
|
+
* **Atomic Facts:** A list of the most critical, standalone pieces of information.
|
17
|
+
|
18
|
+
### 2\. Synthetic Q\&A Generation
|
19
|
+
|
20
|
+
Next, our pipeline leverages user-provided "seed examples"—sample questions and answers—to generate a wealth of synthetic Q\&A pairs. These new pairs are contextually grounded in the summarized documents, effectively scaling up your initial examples into a diverse training dataset.
|
21
|
+
|
22
|
+
### 3\. Quality Control
|
23
|
+
|
24
|
+
To ensure the integrity of our generated data, we employ a quality-checking phase. Using a "teacher" model, we perform a faithfulness evaluation by:
|
25
|
+
|
26
|
+
1. Providing the model with a generated answer and the original source document.
|
27
|
+
2. Tasking the model to extract every claim made in the answer.
|
28
|
+
3. Verifying that each claim is factually supported by the provided document.
|
29
|
+
|
30
|
+
This process filters out inaccuracies and ensures that only high-quality, faithful Q\&A pairs make it into the final dataset.
|
31
|
+
|
32
|
+
## Getting Started
|
33
|
+
|
34
|
+
To begin using the pipeline, simply install the `sdg_hub` library. From there, you can instantiate and run the synthetic data generation process with the following code:
|
35
|
+
|
36
|
+
```python
|
37
|
+
from sdg_hub.flow import Flow
|
38
|
+
from sdg_hub.sdg import SDG
|
39
|
+
|
40
|
+
# Load the knowledge generation pipeline from the YAML file
|
41
|
+
knowledge_agentic_pipeline = "../../../src/instructlab/sdg/flows/generation/knowledge/synth_knowledge1.5.yaml"
|
42
|
+
flow = Flow(openai_client).get_flow_from_file(knowledge_agentic_pipeline)
|
43
|
+
|
44
|
+
# Initialize the Synthetic Data Generator
|
45
|
+
generator = SDG(
|
46
|
+
flows=[flow],
|
47
|
+
num_workers=1,
|
48
|
+
batch_size=1,
|
49
|
+
save_freq=1000,
|
50
|
+
)
|
51
|
+
```
|
52
|
+
|
53
|
+
## InstructLab Training Methodology
|
54
|
+
|
55
|
+
Our training process is structured to build upon a pre-trained model, systematically enhancing its skills and knowledge.
|
56
|
+
|
57
|
+
1. **Foundation Training:** We begin by training a pre-trained model on foundational skills such as logic, coding, and math. The instruction data in this phase features short, direct responses.
|
58
|
+
2. **Foundation Knowledge:** Next, we expand the model's general knowledge base, by training it on general textbooks and benchmarking it against MMLU. The result of these first two stages is what we term the **starter model**.
|
59
|
+
|
60
|
+
This **starter model** then serves as the base for our specialized, two-phase knowledge tuning:
|
61
|
+
|
62
|
+
* **Phase 1: Knowledge Tuning:** We do pre-training style training on the document generated data by our pipeline. This allows the model to internalize the new knowledge and be able to recall and answer questions based on it.
|
63
|
+
* **Phase 2: Skills Tuning:** Building on the previous phase, we do instruction tuning on general skills (combination of instruction tuning dataset and skills generated with sdg_hub). To prevent the model from forgetting the newly acquired knowledge, we mix in data from the previous stage. We also incorporate [RAFT-style](https://openreview.net/forum?id=rzQGHXNReU) data to enhance the model's robustness for RAG on the target documents.
|
64
|
+
|
65
|
+
## Data Post-Processing
|
66
|
+
|
67
|
+
After generating your data, use the provided utility functions to prepare it for the two-phase training process. All helper functions are located in `examples/knowledge_tuning/knowledge_utils.py`.
|
68
|
+
|
69
|
+
### 1\. Knowledge Dataset (for Phase 1)
|
70
|
+
|
71
|
+
This dataset is used for the initial knowledge-tuning phase. You can also merge datasets from multiple documents to train on a set of documents simultaneously.
|
72
|
+
|
73
|
+
This function also creates a summarization dataset that formats the generated summaries as task: document + instruction -> document summary.
|
74
|
+
|
75
|
+
```python
|
76
|
+
from knowledge_utils import create_knowledge_pretraining_ds
|
77
|
+
|
78
|
+
# Create the dataset for knowledge pre-training
|
79
|
+
knowledge_data = create_knowledge_pretraining_ds(generated_dataset=generated_data)
|
80
|
+
```
|
81
|
+
|
82
|
+
### 2\. Skills Dataset (for Phase 2)
|
83
|
+
|
84
|
+
This dataset combines the knowledge-specific data with RAFT-style examples for the second phase of tuning. It can also be mixed with general instruction-tuning data to grant the model broad instruction-following abilities while retaining the specialized knowledge.
|
85
|
+
|
86
|
+
```python
|
87
|
+
from knowledge_utils import create_knowledge_regular_ds
|
88
|
+
from datasets import concatenate_datasets
|
89
|
+
|
90
|
+
# Create the dataset with RAFT and summary data
|
91
|
+
raft_and_summary_data = create_knowledge_regular_ds(generated_dataset=generated_data)
|
92
|
+
|
93
|
+
# Create the core knowledge dataset.
|
94
|
+
# add_auxiliary_dataset parameter controls wheter to add the summarization dataset that was mentioned above in the returned dataset
|
95
|
+
knowledge_data = create_knowledge_pretraining_ds(generated_dataset=generated_data, add_auxiliary_dataset=False)
|
96
|
+
|
97
|
+
# Combine the datasets for the skills tuning phase
|
98
|
+
knowledge_skills_data = concatenate_datasets([raft_and_summary_data, knowledge_data])
|
99
|
+
```
|
100
|
+
|
101
|
+
---
|
102
|
+
|
103
|
+
## Generation Statistics
|
104
|
+
|
105
|
+
Default generation parameters (based on `llama-3.3-70B`) are defined in:
|
106
|
+
[`synth_knowledge1.5.yaml`](../../src/sdg_hub/flows/generation/knowledge/synth_knowledge1.5.yaml)
|
107
|
+
|
108
|
+
* The pipeline converts each input document into **3 summaries**
|
109
|
+
* Outputs vary based on teacher model and generation parameters (e.g. `temperature`, `top_p`, `top_k`) and can be entered in the `gen_kwargs` section of the flow.
|
110
|
+
* Generation currently uses temperature=0.0 and is deterministic.
|
@@ -34,7 +34,6 @@
|
|
34
34
|
"\n",
|
35
35
|
"# First Party\n",
|
36
36
|
"from sdg_hub.flow import Flow\n",
|
37
|
-
"from sdg_hub.pipeline import Pipeline\n",
|
38
37
|
"from sdg_hub.sdg import SDG\n",
|
39
38
|
"import sys\n",
|
40
39
|
"import os\n",
|
@@ -86,9 +85,9 @@
|
|
86
85
|
"outputs": [],
|
87
86
|
"source": [
|
88
87
|
"knowledge_agentic_pipeline = \"../../../src/instructlab/sdg/flows/generation/knowledge/synth_knowledge1.5.yaml\"\n",
|
89
|
-
"
|
88
|
+
"flow = Flow(client).get_flow_from_file(knowledge_agentic_pipeline)\n",
|
90
89
|
"sdg = SDG(\n",
|
91
|
-
" [
|
90
|
+
" flows=[flow],\n",
|
92
91
|
" num_workers=1,\n",
|
93
92
|
" batch_size=1,\n",
|
94
93
|
" save_freq=1000,\n",
|
@@ -268,7 +268,22 @@ def build_raft_dataset(ds: Dataset, p, num_doc_in_context=4):
|
|
268
268
|
|
269
269
|
|
270
270
|
def create_knowledge_regular_ds(generated_dataset: Dataset):
|
271
|
-
|
271
|
+
"""
|
272
|
+
Create a knowledge dataset for the Skills Phase of knowledge tuning.
|
273
|
+
|
274
|
+
This function generates QA datasets with RAFT-style context separation
|
275
|
+
and optionally includes auxiliary datasets for enhanced training.
|
276
|
+
|
277
|
+
Parameters
|
278
|
+
----------
|
279
|
+
generated_dataset : Dataset
|
280
|
+
The input dataset containing generated knowledge content
|
281
|
+
|
282
|
+
Returns
|
283
|
+
-------
|
284
|
+
Dataset
|
285
|
+
Processed dataset ready for skills phase training
|
286
|
+
"""
|
272
287
|
knowledge_ds = generate_knowledge_qa_dataset(
|
273
288
|
generated_dataset, keep_context_separate=True
|
274
289
|
)
|
@@ -276,26 +291,36 @@ def create_knowledge_regular_ds(generated_dataset: Dataset):
|
|
276
291
|
|
277
292
|
auxiliary_dataset = create_auxiliary_dataset(generated_dataset)
|
278
293
|
if auxiliary_dataset is not None:
|
279
|
-
|
280
|
-
|
281
|
-
transformed_data = knowledge_ds
|
282
|
-
return transformed_data
|
294
|
+
knowledge_ds = safe_concatenate_datasets([knowledge_ds, auxiliary_dataset])
|
295
|
+
return knowledge_ds
|
283
296
|
|
284
297
|
|
285
|
-
def create_knowledge_pretraining_ds(generated_dataset: Dataset):
|
286
|
-
# Phase 0.7
|
298
|
+
def create_knowledge_pretraining_ds(generated_dataset: Dataset, add_auxiliary_dataset: bool = True):
|
299
|
+
# Phase 0.7 (Knowledge Phase)
|
300
|
+
"""
|
301
|
+
Create a knowledge dataset for the Knowledge Phase of knowledge tuning.
|
302
|
+
|
303
|
+
This function generates QA datasets for pretraining-style knowledge tuning
|
304
|
+
with optional auxiliary dataset inclusion.
|
305
|
+
|
306
|
+
Parameters
|
307
|
+
----------
|
308
|
+
generated_dataset (Dataset): The dataset containing generated knowledge data.
|
309
|
+
add_auxiliary_dataset (bool): Whether to include an auxiliary dataset.
|
310
|
+
|
311
|
+
Returns
|
312
|
+
-------
|
313
|
+
Dataset: The generated knowledge dataset.
|
314
|
+
"""
|
287
315
|
knowledge_ds = generate_knowledge_qa_dataset(
|
288
|
-
generated_dataset, keep_context_separate=False
|
289
|
-
)
|
316
|
+
generated_dataset, keep_context_separate=False)
|
290
317
|
knowledge_ds = knowledge_ds.map(_conv_pretrain)
|
291
318
|
|
292
319
|
auxiliary_dataset = create_auxiliary_dataset(generated_dataset)
|
293
|
-
if auxiliary_dataset is not None:
|
320
|
+
if auxiliary_dataset is not None and add_auxiliary_dataset:
|
294
321
|
auxiliary_dataset = auxiliary_dataset.map(_conv_pretrain)
|
295
|
-
|
296
|
-
|
297
|
-
transformed_data = knowledge_ds
|
298
|
-
return transformed_data
|
322
|
+
knowledge_ds = safe_concatenate_datasets([knowledge_ds, auxiliary_dataset])
|
323
|
+
return knowledge_ds
|
299
324
|
|
300
325
|
|
301
326
|
def fuse_texts(text_list, short_length_threshold=100):
|
{sdg_hub-0.1.3 → sdg_hub-0.1.4}/src/sdg_hub/flows/generation/knowledge/synth_knowledge1.5.yaml
RENAMED
@@ -12,9 +12,7 @@
|
|
12
12
|
output_cols:
|
13
13
|
- summary_detailed
|
14
14
|
gen_kwargs:
|
15
|
-
max_tokens:
|
16
|
-
temperature: 0.7
|
17
|
-
n: 50
|
15
|
+
max_tokens: 2048
|
18
16
|
|
19
17
|
- block_type: LLMBlock
|
20
18
|
block_config:
|
@@ -24,8 +22,7 @@
|
|
24
22
|
output_cols:
|
25
23
|
- summary_atomic_facts
|
26
24
|
gen_kwargs:
|
27
|
-
max_tokens:
|
28
|
-
temperature: 0.7
|
25
|
+
max_tokens: 2048
|
29
26
|
|
30
27
|
- block_type: LLMBlock
|
31
28
|
block_config:
|
@@ -35,8 +32,7 @@
|
|
35
32
|
output_cols:
|
36
33
|
- summary_extractive
|
37
34
|
gen_kwargs:
|
38
|
-
max_tokens:
|
39
|
-
temperature: 0.7
|
35
|
+
max_tokens: 2048
|
40
36
|
|
41
37
|
- block_type: FlattenColumnsBlock
|
42
38
|
block_config:
|
@@ -59,26 +55,18 @@
|
|
59
55
|
- block_type: LLMBlock
|
60
56
|
block_config:
|
61
57
|
block_name: knowledge generation
|
62
|
-
config_path: configs/knowledge/
|
58
|
+
config_path: configs/knowledge/generate_questions_responses.yaml
|
63
59
|
model_id: meta-llama/Llama-3.3-70B-Instruct
|
64
60
|
output_cols:
|
65
61
|
- question
|
62
|
+
- response
|
66
63
|
parser_kwargs:
|
67
64
|
parser_name: custom
|
68
|
-
parsing_pattern: "\\[(?:Question|QUESTION)\\]\\s*(.*?)\\s*(?=\\[(?:Question|QUESTION)\\]|$)"
|
69
|
-
|
70
|
-
|
71
|
-
max_tokens: 100
|
72
|
-
|
73
|
-
- block_type: LLMBlock
|
74
|
-
block_config:
|
75
|
-
block_name: knowledge generation
|
76
|
-
config_path: configs/knowledge/generate_responses.yaml
|
77
|
-
model_id: meta-llama/Llama-3.3-70B-Instruct
|
78
|
-
output_cols:
|
79
|
-
- response
|
65
|
+
parsing_pattern: "\\[(?:Question|QUESTION)\\]\\s*(.*?)\\s*\\[(?:Answer|ANSWER)\\]\\s*(.*?)\\s*(?=\\[(?:Question|QUESTION)\\]|$)"
|
66
|
+
parser_cleanup_tags:
|
67
|
+
- "[END]"
|
80
68
|
gen_kwargs:
|
81
|
-
temperature: 0.
|
69
|
+
temperature: 0.0
|
82
70
|
max_tokens: 2048
|
83
71
|
|
84
72
|
- block_type: LLMBlock
|
@@ -12,7 +12,7 @@ def instructlab_chat_template():
|
|
12
12
|
return """{% for message in messages %}{% if message['role'] == 'pretraining' %}{{ '<|pretrain|>' + message['content'] + '<|endoftext|>' + '<|/pretrain|>' }}{% elif message['role'] == 'system' %}{{ '<|system|>' + '\n' + message['content'] + '\n' }}{% elif message['role'] == 'user' %}{{ '<|user|>' + '\n' + message['content'] + '\n' }}{% elif message['role'] == 'assistant' %}{{ '<|assistant|>' + '\n' + message['content'] + '<|endoftext|>' + ('' if loop.last else '\n') }}{% endif %}{% if loop.last and add_generation_prompt %}{{ '<|assistant|>' + '\n' }}{% endif %}{% endfor %}"""
|
13
13
|
|
14
14
|
|
15
|
-
@PromptRegistry.register("mistralai")
|
15
|
+
@PromptRegistry.register("mistralai/Mixtral")
|
16
16
|
def mistral_chat_template():
|
17
17
|
return """{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content'] %}\n {%- set loop_messages = messages[1:] %}\n{%- else %}\n {%- set loop_messages = messages %}\n{%- endif %}\n\n<s>\n{%- for message in loop_messages %}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}\n {{- raise_exception('After the optional system message, conversation roles must alternate user/assistant/user/assistant/...') }}\n {%- endif %}\n {%- if message['role'] == 'user' %}\n {%- if loop.first and system_message is defined %}\n {{- ' [INST] ' + system_message + '\\n\\n' + message['content'] + ' [/INST]' }}\n {%- else %}\n {{- ' [INST] ' + message['content'] + ' [/INST]' }}\n {%- endif %}\n {%- elif message['role'] == 'assistant' %}\n {{- ' ' + message['content'] + '</s>'}}\n {%- else %}\n {{- raise_exception('Only user and assistant roles are supported, with the exception of an initial optional system message!') }}\n {%- endif %}\n{%- endfor %}\n"""
|
18
18
|
|
@@ -26,11 +26,12 @@ def meta_llama_chat_template():
|
|
26
26
|
def microsoft_phi_chat_template():
|
27
27
|
return """{% for message in messages %}{% if (message['role'] == 'system') %}{{'<|im_start|>system<|im_sep|>' + message['content'] + '<|im_end|>'}}{% elif (message['role'] == 'user') %}{{'<|im_start|>user<|im_sep|>' + message['content'] + '<|im_end|>'}}{% elif (message['role'] == 'assistant') %}{{'<|im_start|>assistant<|im_sep|>' + message['content'] + '<|im_end|>'}}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant<|im_sep|>' }}{% endif %}"""
|
28
28
|
|
29
|
+
|
29
30
|
@PromptRegistry.register("nvidia/Llama-3_3-Nemotron-Super-49B-v1")
|
30
31
|
def nemotron_chat_template():
|
31
32
|
"""
|
32
33
|
Format chat messages for the Nemotron model, including a system prompt and structured message headers.
|
33
|
-
|
34
|
+
|
34
35
|
The template starts with a system message containing "detailed thinking on", then iterates over messages, wrapping each with start and end header tokens and an end-of-text token. For assistant messages containing a `</think>` tag, only the content after this tag is included. Optionally appends an assistant prompt if generation is requested.
|
35
36
|
"""
|
36
37
|
return """{{- bos_token }}
|
@@ -52,7 +53,7 @@ def nemotron_chat_template():
|
|
52
53
|
def qwen_2_5_chat_template():
|
53
54
|
"""
|
54
55
|
Formats chat messages into the prompt structure required by the Qwen 2.5 model family, supporting system messages, tool descriptions, function call instructions, and role-based message formatting.
|
55
|
-
|
56
|
+
|
56
57
|
If tools are provided, includes tool signatures and instructions for function calls in the system prompt. User, assistant, and tool messages are wrapped with special tokens, and assistant tool calls are serialized as JSON within XML tags. Optionally appends a generation prompt for the assistant.
|
57
58
|
"""
|
58
59
|
return """{%- if tools %}\n {{- \'<|im_start|>system\\n\' }}\n {%- if messages[0][\'role\'] == \'system\' %}\n {{- messages[0][\'content\'] }}\n {%- else %}\n {{- \'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.\' }}\n {%- endif %}\n {{- "\\n\\n# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>" }}\n {%- for tool in tools %}\n {{- "\\n" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- "\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\"name\\": <function-name>, \\"arguments\\": <args-json-object>}\\n</tool_call><|im_end|>\\n" }}\n{%- else %}\n {%- if messages[0][\'role\'] == \'system\' %}\n {{- \'<|im_start|>system\\n\' + messages[0][\'content\'] + \'<|im_end|>\\n\' }}\n {%- else %}\n {{- \'<|im_start|>system\\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\\n\' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}\n {{- \'<|im_start|>\' + message.role + \'\\n\' + message.content + \'<|im_end|>\' + \'\\n\' }}\n {%- elif message.role == "assistant" %}\n {{- \'<|im_start|>\' + message.role }}\n {%- if message.content %}\n {{- \'\\n\' + message.content }}\n {%- endif %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- \'\\n<tool_call>\\n{"name": "\' }}\n {{- tool_call.name }}\n {{- \'", "arguments": \' }}\n {{- tool_call.arguments | tojson }}\n {{- \'}\\n</tool_call>\' }}\n {%- endfor %}\n {{- \'<|im_end|>\\n\' }}\n {%- elif message.role == "tool" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}\n {{- \'<|im_start|>user\' }}\n {%- endif %}\n {{- \'\\n<tool_response>\\n\' }}\n {{- message.content }}\n {{- \'\\n</tool_response>\' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}\n {{- \'<|im_end|>\\n\' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- \'<|im_start|>assistant\\n\' }}\n{%- endif %}\n"""
|
@@ -62,9 +63,9 @@ def qwen_2_5_chat_template():
|
|
62
63
|
def qwen_3_chat_template():
|
63
64
|
"""
|
64
65
|
Formats chat messages for the Qwen 3 model family, supporting multi-step tool usage, reasoning content, and special XML tags for tool calls and responses.
|
65
|
-
|
66
|
+
|
66
67
|
This template handles system messages, user and assistant roles, and tool interactions. When tools are provided, it outputs their signatures and instructions for function calls. It tracks the last user query to determine where to insert assistant reasoning content within `<think>` tags. Assistant tool calls are serialized as JSON within `<tool_call>` tags, and tool responses are grouped inside `<tool_response>` tags. Optionally, a generation prompt and empty reasoning block can be added.
|
67
|
-
|
68
|
+
|
68
69
|
Parameters:
|
69
70
|
tools (optional): List of tool signature objects to be included in the prompt.
|
70
71
|
messages: List of message objects, each with a role and content, and optionally tool_calls or reasoning_content.
|
@@ -72,3 +73,8 @@ def qwen_3_chat_template():
|
|
72
73
|
enable_thinking (optional): If false, inserts an empty reasoning block in the assistant prompt.
|
73
74
|
"""
|
74
75
|
return """{%- if tools %}\n {{- \'<|im_start|>system\\n\' }}\n {%- if messages[0].role == \'system\' %}\n {{- messages[0].content + \'\\n\\n\' }}\n {%- endif %}\n {{- "# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>" }}\n {%- for tool in tools %}\n {{- "\\n" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- "\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\"name\\": <function-name>, \\"arguments\\": <args-json-object>}\\n</tool_call><|im_end|>\\n" }}\n{%- else %}\n {%- if messages[0].role == \'system\' %}\n {{- \'<|im_start|>system\\n\' + messages[0].content + \'<|im_end|>\\n\' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith(\'<tool_response>\') and message.content.endswith(\'</tool_response>\')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if message.content is string %}\n {%- set content = message.content %}\n {%- else %}\n {%- set content = \'\' %}\n {%- endif %}\n {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}\n {{- \'<|im_start|>\' + message.role + \'\\n\' + content + \'<|im_end|>\' + \'\\n\' }}\n {%- elif message.role == "assistant" %}\n {%- set reasoning_content = \'\' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if \'</think>\' in content %}\n {%- set reasoning_content = content.split(\'</think>\')[0].rstrip(\'\\n\').split(\'<think>\')[-1].lstrip(\'\\n\') %}\n {%- set content = content.split(\'</think>\')[-1].lstrip(\'\\n\') %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index %}\n {%- if loop.last or (not loop.last and reasoning_content) %}\n {{- \'<|im_start|>\' + message.role + \'\\n<think>\\n\' + reasoning_content.strip(\'\\n\') + \'\\n</think>\\n\\n\' + content.lstrip(\'\\n\') }}\n {%- else %}\n {{- \'<|im_start|>\' + message.role + \'\\n\' + content }}\n {%- endif %}\n {%- else %}\n {{- \'<|im_start|>\' + message.role + \'\\n\' + content }}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- \'\\n\' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- \'<tool_call>\\n{"name": "\' }}\n {{- tool_call.name }}\n {{- \'", "arguments": \' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- \'}\\n</tool_call>\' }}\n {%- endfor %}\n {%- endif %}\n {{- \'<|im_end|>\\n\' }}\n {%- elif message.role == "tool" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}\n {{- \'<|im_start|>user\' }}\n {%- endif %}\n {{- \'\\n<tool_response>\\n\' }}\n {{- content }}\n {{- \'\\n</tool_response>\' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}\n {{- \'<|im_end|>\\n\' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- \'<|im_start|>assistant\\n\' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- \'<think>\\n\\n</think>\\n\\n\' }}\n {%- endif %}\n{%- endif %}"""
|
76
|
+
|
77
|
+
|
78
|
+
@PromptRegistry.register("mistralai/Mistral-Small-3")
|
79
|
+
def mistral_small_3_chat_template():
|
80
|
+
return """{%- if not date_string is defined %}\n {%- set date_string = \"2025-01-01\" %}\n{%- endif %}\n{%- set default_system_message = \"You are Mistral Small 3, a Large Language Model (LLM) created by Mistral AI, a French startup headquartered in Paris.\\nYour knowledge base was last updated on 2023-10-01. The current date is \" + date_string + \".\\n\\nWhen you're not sure about some information, you say that you don't have the information and don't make up anything.\\nIf the user's question is not clear, ambiguous, or does not provide enough context for you to accurately answer the question, you do not try to answer it right away and you rather ask the user to clarify their request (e.g. \\\"What are some good restaurants around me?\\\" => \\\"Where are you?\\\" or \\\"When is the next flight to Tokyo\\\" => \\\"Where do you travel from?\\\")\" %}\n\n<s>\n\n{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content'] %}\n {%- set loop_messages = messages[1:] %}\n{%- else %}\n {%- set system_message = default_system_message %}\n {%- set loop_messages = messages %}\n{%- endif %}\n{{- '[SYSTEM_PROMPT]' + system_message + '[/SYSTEM_PROMPT]' }}\n\n{%- for message in loop_messages %}\n {%- if message['role'] == 'user' %}\n {{- '[INST]' + message['content'] + '[/INST]' }}\n {%- elif message['role'] == 'system' %}\n {{- '[SYSTEM_PROMPT]' + message['content'] + '[/SYSTEM_PROMPT]' }}\n {%- elif message['role'] == 'assistant' %}\n {{- message['content'] + '</s>' }}\n {%- else %}\n {{- raise_exception('Only user, system and assistant roles are supported!') }}\n {%- endif %}\n{%- endfor %}"""
|
@@ -44,9 +44,11 @@ docs/installation.md
|
|
44
44
|
docs/prompts.md
|
45
45
|
docs/quick-start.md
|
46
46
|
docs/web-interface.md
|
47
|
+
examples/knowledge_tuning/README.md
|
47
48
|
examples/knowledge_tuning/knowledge_utils.py
|
48
49
|
examples/knowledge_tuning/data-generation-with-llama-70b/data-generation-with-llama-70b.ipynb
|
49
50
|
examples/knowledge_tuning/data-generation-with-llama-70b/synth_knowledge1.5_llama3.3.yaml
|
51
|
+
examples/knowledge_tuning/instructlab/README.md
|
50
52
|
examples/knowledge_tuning/instructlab/docparser.py
|
51
53
|
examples/knowledge_tuning/instructlab/docparser_v2.py
|
52
54
|
examples/knowledge_tuning/instructlab/document_pre_processing.ipynb
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{sdg_hub-0.1.3 → sdg_hub-0.1.4}/examples/knowledge_tuning/instructlab/document_pre_processing.ipynb
RENAMED
File without changes
|
File without changes
|