Skip to content

Latest commit

 

History

History
94 lines (61 loc) · 5.87 KB

README.md

File metadata and controls

94 lines (61 loc) · 5.87 KB

AI Powered Notes app [Sample]

This sample is a simple note taking app that uses local APIs and models to provide AI powered features. The app is built using WinUI3.

image

Watch the Build session: Use AI for "Real Things" in your Windows apps

Set Up

You will need to have Visual Studio installed with the latest workloads for WinAppSDK and WinUI 3 development. You can find instructions on how to set up your environment here.

Clone the repository and open the solution in Visual Studio. Before you can get started exploring the sample, you will need to download the ML model files required for the project and place them in the onnx-models folder.

The final folder structure should look like this:

image

Note

Many of these models can be downloaded quickly using the AI Dev Gallery.

AI Dev Gallery

Store badge

Phi Silica

Phi Silica is disabled by deault, but you can enable it in App.xaml.cs in the InitializeIChatClient method. To use Phi Silica for the generative tasks, see requirements here: https://learn.microsoft.com/en-us/windows/ai/apis/phi-silica

Downloading Phi3.5 (or other GenAI model)

The model can be downloaded from the following link:

Use the AI Dev Gallery linked above to download the model files. Alternatively, Huggingface models are in repositories which you can clone to get the model files. Clone the model repository and copy the required files to this project.

Note

You can use any GenAI model by downloading the right model files and droping them in the genai-model folder. If using a model other than phi, make sure to also update the prompt template in the App.xaml.cs

Downloading all-MiniLM-L6-v2

The model can be downloaded from the following link:

This is model we use for semantic search. The two files you will need are model.onnx and vocab.txt. Create a new folder under onnx-models called embedding and place the files there.

Downloading Sliero VAD

The Sliero Voice Activity Detection model can be downloaded from the following link:

This is the model we use for smart chunking of audio and the only file you will need is the sliero_vad.onnx file.

This should also be placed under a new folder called whisper under the onnx-models folder.

Downloading Whisper

The Whisper model can be downloaded from the following link:

Download any of the versions on the repo or from the AI Dev Gallery and place them in the onnx-models\whisper folder. Make sure the path in AI\Whisper\Whisper.cs in the InitializeModel method reflects the same name: image

Troubleshooting

Path name too long

You might run into an issue if you clone the repo in a location that will make the path too long to some of the generated binaries. Recomendation is to place the repo closer to the root of the drive and rename the repo folder name to something shorter. Alternatively, you can change the settings in Windows to support long paths https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#enable-long-paths-in-windows-10-version-1607-and-later .

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. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

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. 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.