-
Notifications
You must be signed in to change notification settings - Fork 313
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 #74 from skytin1004/main
Fixed all invalid URLs, Add GitHub Actions workflow to validate documentation links
- Loading branch information
Showing
42 changed files
with
664 additions
and
572 deletions.
There are no files selected for viewing
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,62 @@ | ||
name: Validate Documentation Links | ||
|
||
on: | ||
pull_request_target: | ||
branches: | ||
- main | ||
paths: | ||
- '**.md' | ||
- '**.ipynb' | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
check-broken-paths: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Check broken Paths | ||
uses: john0isaac/[email protected] | ||
with: | ||
command: check_broken_paths | ||
directory: ./ | ||
guide-url: 'https://github.com/Phi-3-CookBook/Phi-3-CookBook/blob/main/CONTRIBUTING.md' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
check-urls-locale: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Check URLs Country Locale | ||
uses: john0isaac/[email protected] | ||
with: | ||
command: check_urls_locale | ||
directory: ./ | ||
guide-url: 'https://github.com/Phi-3-CookBook/Phi-3-CookBook/blob/main/CONTRIBUTING.md' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
check-broken-urls: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Check broken URLs | ||
uses: john0isaac/[email protected] | ||
with: | ||
command: check_broken_urls | ||
directory: ./ | ||
guide-url: 'https://github.com/Phi-3-CookBook/Phi-3-CookBook/blob/main/CONTRIBUTING.md' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
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,107 @@ | ||
# Contributing | ||
|
||
This project welcomes contributions and suggestions. Most contributions require you to agree to a | ||
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us | ||
the rights to use your contribution. For details, visit [https://cla.opensource.microsoft.com](https://cla.opensource.microsoft.com) | ||
|
||
When you submit a pull request, a CLA bot will automatically determine whether you need to provide | ||
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions | ||
provided by the bot. You will only need to do this once across all repos using our CLA. | ||
|
||
## Code of Conduct | ||
|
||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). | ||
For more information read the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments. | ||
|
||
## Cautions for creating issues | ||
|
||
Please do not open GitHub issues for general support questions as the GitHub list should be used for feature requests and bug reports. This way we can more easily track actual issues or bugs from the code and keep the general discussion separate from the actual code. | ||
|
||
## How to Contribute | ||
|
||
### Pull Requests Guidelines | ||
|
||
When submitting a pull request (PR) to the Phi-3 CookBook repository, please use the following guidelines: | ||
|
||
- **Fork the Repository**: Always fork the repository to your own account before making your modifications. | ||
|
||
- **Separate pull requests (PR)**: | ||
- Submit each type of change in its own pull request. For example, bug fixes and documentation updates should be submitted in separate PRs. | ||
- Typo fixes and minor documentation updates can be combined into a single PR where appropriate. | ||
|
||
- **Handle merge conflicts**: If your pull request shows merge conflicts, update your local `main` branch to mirror the main repository before making your modifications. | ||
|
||
- **Translation submissions**: When submitting a translation PR, ensure that the translation folder includes translations for all files in the original folder. | ||
|
||
### Translation Guidelines | ||
|
||
> **Important** | ||
> | ||
> When translating text in this repository, do not use machine translation. Only volunteer for translations in languages where you are proficient. | ||
If you are proficient in a non-English language, you can help translate the content. Follow these steps to ensure your translation contributions are properly integrated, please use the following guidelines: | ||
|
||
- **Create translation folder**: Navigate to the appropriate section folder and create a translation folder for the language you are contributing to. For example: | ||
- For the introduction section: `Phi-3CookBook/md/01.Introduce/translations/<language_code>/` | ||
- For the quick start section: `Phi-3CookBook/md/02.QuickStart/translations/<language_code>/` | ||
- Continue this pattern for other sections (03.Inference, 04.Finetuning, etc.) | ||
|
||
- **Update relative paths**: When translating, adjust the folder structure by adding `../../` to the beginning of relative paths within the markdown files to ensure links work correctly. For example, change as following: | ||
- Change `(../../imgs/01/phi3aisafety.png)` to `(../../../../imgs/01/phi3aisafety.png)` | ||
|
||
- **Organize your translations**: Each translated file should be placed in the corresponding section's translation folder. For example, if you are translating the introduction section into Spanish, you would create as following: | ||
- `Phi-3CookBook/md/01.Introduce/translations/es/` | ||
|
||
- **Submit a complete PR**: Ensure all translated files for a section are included in one PR. We do not accept partial translations for a section. When submitting a translation PR, make sure that the translation folder includes translations for all files in the original folder. | ||
|
||
### Writing Guidelines | ||
|
||
To ensure consistency across all documents, please use the following guidelines: | ||
|
||
- **URL formatting**: Wrap all URLs in square brackets followed by parentheses, without any extra spaces around or inside them. For example: `[example](https://example.com)`. | ||
|
||
- **Relative links**: Use `./` for relative links pointing to files or folders in the current directory, and `../` for those in a parent directory. For example: `[example](./path/to/file)` or `[example](../path/to/file)`. | ||
|
||
- **Not Country-Specific locales**: Ensure that your links do not include country-specific locales. For example, avoid `/en-us/` or `/en/`. | ||
|
||
- **Image storage**: Store all images in the `./imgs` folder. | ||
|
||
- **Descriptive image names**: Name images descriptively using English characters, numbers, and dashes. For example: `example-image.jpg`. | ||
|
||
## GitHub Workflows | ||
|
||
When you submit a pull request, the following workflows will be triggered to validate the changes. Follow the instructions below to ensure your pull request passes the workflow checks: | ||
|
||
- [Check Broken Relative Paths](#check-broken-relative-paths) | ||
- [Check URLs Don't Have Locale](#check-urls-dont-have-locale) | ||
|
||
### Check Broken Relative Paths | ||
|
||
This workflow ensures that all relative paths in your files are correct. | ||
|
||
1. To make sure your links are working properly, perform the following tasks using VS Code: | ||
- Hover over any link in your files. | ||
- Press **Ctrl + Click** to navigate to the link. | ||
- If you click on a link and it doesn't work locally, it will trigger the workflow and not work on GitHub. | ||
|
||
1. To fix this issue, perform the following tasks using the path suggestions provided by VS Code: | ||
- Type `./` or `../`. | ||
- VS Code will prompt you to choose from the available options based on what you typed. | ||
- Follow the path by clicking on the desired file or folder to ensure your path is correct. | ||
|
||
Once you have added the correct relative path, save and push your changes. | ||
|
||
### Check URLs Don't Have Locale | ||
|
||
This workflow ensures that any web URL doesn't include a country-specific locale. As this repository is accessible globally, it is important to ensure that URLs do not contain your country's locale. | ||
|
||
1. To verify that your URLs don't have country locales, perform the following tasks: | ||
|
||
- Check for text like `/en-us/`, `/en/`, or any other language locale in the URLs. | ||
- If these are not present in your URLs, then you will pass this check. | ||
|
||
1. To fix this issue, perform the following tasks: | ||
- Open the file path highlighted by the workflow. | ||
- Remove the country locale from the URLs. | ||
|
||
Once you remove the country locale, save and push your changes. |
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 |
---|---|---|
|
@@ -100,8 +100,8 @@ This cookbook includes: | |
|
||
- [Fine-tuning Phi-3]() | ||
- [Downloading & Creating Sample Data Set](./md/04.Fine-tuning/CreatingSampleData.md)(✅) | ||
- [Fine-tuning Scenarios](./md/04.Fine-tuning/FineTuning%20Scenarios.md)(✅) | ||
- [Fine-tuning vs RAG](./md/04.Fine-tuning/FineTuning%20vs%20RAG.md)(✅) | ||
- [Fine-tuning Scenarios](./md/04.Fine-tuning/FineTuning_Scenarios.md)(✅) | ||
- [Fine-tuning vs RAG](./md/04.Fine-tuning/FineTuning_vs_RAG.md)(✅) | ||
- [Fine-tuning Let Phi-3 become an industry expert](./md/04.Fine-tuning/LetPhi3gotoIndustriy.md)(✅) | ||
- [Fine-tuning Phi-3 with AI Toolkit for VS Code](./md/04.Fine-tuning/Finetuning_VSCodeaitoolkit.md)(✅) | ||
- [Fine-tuning Phi-3 with Azure Machine Learning Service](./md/04.Fine-tuning/Introduce_AzureML.md)(✅) | ||
|
@@ -124,7 +124,7 @@ This cookbook includes: | |
- [Prepare your industry data](./md/06.E2ESamples/E2E_Datasets.md)(✅) | ||
- [Use Microsoft Olive to architect your projects](./md/06.E2ESamples/E2E_LoRA&QLoRA_Config_With_Olive.md)(✅) | ||
- [Inference Your Fine-tuning ONNX Runtime Model](./md/06.E2ESamples/E2E_Inference_ORT.md)(✅) | ||
- [Multi Model - Interactive Phi-3-mini and OpenAI Whisper](./md/06.E2ESamples/E2E_Phi-3-mini%20with%20whisper.md)(✅) | ||
- [Multi Model - Interactive Phi-3-mini and OpenAI Whisper](./md/06.E2ESamples/E2E_Phi-3-mini_with_whisper.md)(✅) | ||
- [MLFlow - Building a wrapper and using Phi-3 with MLFlow](./md/06.E2ESamples/E2E_Phi-3-MLflow.md)(✅) | ||
- [WinUI3 App with Phi-3 mini-4k-instruct-onnx](https://github.com/microsoft/Phi3-Chat-WinUI3-Sample/)(✅) | ||
- [WinUI3 Multi Model AI Powered Notes App Sample](https://github.com/microsoft/ai-powered-notes-winui3-sample)(✅) | ||
|
@@ -133,7 +133,7 @@ This cookbook includes: | |
- [E2E Samples for Phi-3-vision]() | ||
- [Phi-3-vision-Image text to text](./md/06.E2ESamples/E2E_Phi-3-vision-image-text-to-text-online-endpoint.ipynb)(✅) | ||
- [Phi-3-vision-ONNX](https://onnxruntime.ai/docs/genai/tutorials/phi3-v.html)(✅) | ||
- [Phi-3-vision CLIP Embedding](./md/06.E2ESamples/E2E_Phi-3-%20Embedding%20Images%20with%20CLIPVision.md)(✅) | ||
- [Phi-3-vision CLIP Embedding](./md/06.E2ESamples/E2E_Phi-3-Embedding_Images_with_CLIPVision.md)(✅) | ||
|
||
- [Labs and workshops samples Phi-3]() | ||
- [C# .NET Labs](./md/07.Labs/Csharp/csharplabs.md)(✅) | ||
|
@@ -145,26 +145,10 @@ This cookbook includes: | |
- [C# Hello Phi-3 ONNX example Phi-3](https://github.com/microsoft/onnxruntime-genai/tree/main/examples/csharp/HelloPhi)(✅) | ||
- [C# API Phi-3 ONNX example to support Phi3-Vision](https://github.com/microsoft/onnxruntime-genai/tree/main/examples/csharp/HelloPhi3V)(✅) | ||
- [Run C# Phi-3 samples in a CodeSpace](./md/07.Labs/CsharpOllamaCodeSpaces/CsharpOllamaCodeSpaces.md)(✅) | ||
- [Using Phi-3 with Promptflow and Azure AI Search](./code/07.Lab/RAG%20with%20PromptFlow%20and%20AISearch/README.md)(✅) | ||
|
||
## Contributing | ||
|
||
This project welcomes contributions and suggestions. Most contributions require you to agree to a | ||
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us | ||
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. | ||
|
||
When you submit a pull request, a CLA bot will automatically determine whether you need to provide | ||
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions | ||
provided by the bot. You will only need to do this once across all repos using our CLA. | ||
|
||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). | ||
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or | ||
contact [[email protected]](mailto:[email protected]) with any additional questions or comments. | ||
- [Using Phi-3 with Promptflow and Azure AI Search](./code/07.Lab/RAG_with_PromptFlow_and_AISearch/README.md)(✅) | ||
|
||
## Trademarks | ||
|
||
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft | ||
trademarks or logos is subject to and must follow | ||
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). | ||
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/legal/intellectualproperty/trademarks/usage/general). | ||
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. | ||
Any use of third-party trademarks or logos are subject to those third-party's policies. |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
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
34 changes: 17 additions & 17 deletions
34
md/04.Fine-tuning/FineTuning Scenarios.md → md/04.Fine-tuning/FineTuning_Scenarios.md
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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
## Fine Tuning Scenarios | ||
|
||
| | | | | | | | | ||
|-|-|-|-|-|-|-| | ||
|Scenario|LoRA|QLoRA|PEFT|DeepSpeed|ZeRO|DORA| | ||
|Adapting pre-trained LLMs to specific tasks or domains|Yes|Yes|Yes|Yes|Yes|Yes| | ||
|Fine-tuning for NLP tasks such as text classification, named entity recognition, and machine translation|Yes|Yes|Yes|Yes|Yes|Yes| | ||
|Fine-tuning for QA tasks|Yes|Yes|Yes|Yes|Yes|Yes| | ||
|Fine-tuning for generating human-like responses in chatbots|Yes|Yes|Yes|Yes|Yes|Yes| | ||
|Fine-tuning for generating music, art, or other forms of creativity|Yes|Yes|Yes|Yes|Yes|Yes| | ||
|Reducing computational and financial costs|Yes|Yes|No|Yes|Yes|No| | ||
|Reducing memory usage|No|Yes|No|Yes|Yes|Yes| | ||
|Using fewer parameters for efficient finetuning|No|Yes|Yes|No|No|Yes| | ||
|Memory-efficient form of data parallelism that gives access to the aggregate GPU memory of all the GPU devices available|No|No|No|Yes|Yes|Yes| | ||
|
||
## Fine Tuning Performance Examples | ||
|
||
## Fine Tuning Scenarios | ||
|
||
| | | | | | | | | ||
|-|-|-|-|-|-|-| | ||
|Scenario|LoRA|QLoRA|PEFT|DeepSpeed|ZeRO|DORA| | ||
|Adapting pre-trained LLMs to specific tasks or domains|Yes|Yes|Yes|Yes|Yes|Yes| | ||
|Fine-tuning for NLP tasks such as text classification, named entity recognition, and machine translation|Yes|Yes|Yes|Yes|Yes|Yes| | ||
|Fine-tuning for QA tasks|Yes|Yes|Yes|Yes|Yes|Yes| | ||
|Fine-tuning for generating human-like responses in chatbots|Yes|Yes|Yes|Yes|Yes|Yes| | ||
|Fine-tuning for generating music, art, or other forms of creativity|Yes|Yes|Yes|Yes|Yes|Yes| | ||
|Reducing computational and financial costs|Yes|Yes|No|Yes|Yes|No| | ||
|Reducing memory usage|No|Yes|No|Yes|Yes|Yes| | ||
|Using fewer parameters for efficient finetuning|No|Yes|Yes|No|No|Yes| | ||
|Memory-efficient form of data parallelism that gives access to the aggregate GPU memory of all the GPU devices available|No|No|No|Yes|Yes|Yes| | ||
|
||
## Fine Tuning Performance Examples | ||
|
||
![Finetuning Performance](../../imgs/04/00/Finetuningexamples.png) |
Oops, something went wrong.