Skip to content

Conversation

@elbruno
Copy link
Contributor

@elbruno elbruno commented Feb 27, 2025

Purpose

This pull request includes several updates and additions to the md/04.HOL/dotnet project, including renaming a file, adding new sample projects, and updating existing code for better functionality. The most important changes are summarized below:

File Renaming and Updates:

  • Renamed md/04.HOL/dotnet/csharplabs.md to md/04.HOL/dotnet/readme.md and updated instructions for downloading models and cloning repositories. [1] [2] [3]

New Sample Projects:

  • Added LabsPhi4-MultiModal-01Images project for analyzing images using the Phi-4 model. [1] [2] [3]
  • Added LabsPhi4-MultiModal-02Audio project for analyzing audio files using the Phi-4 model. [1] [2] [3]

Code Enhancements:

  • Updated LabsPhi4-Chat-01OnnxRuntime/Program.cs to initialize the model earlier and streamline the token generation process. [1] [2]

Solution Configuration:

  • Updated LabsPhi.sln to include new projects and their respective build configurations. [1] [2]

Does this introduce a breaking change?

When developers merge from main and run the server, azd up, or azd deploy, will this produce an error?
If you're not sure, try it out on an old environment.

[ ] Yes
[X] No

Does this require changes to learn.microsoft.com docs?

This repository is referenced by (https://azure.microsoft.com/products/phi-3)
which includes deployment, settings and usage instructions.

[ ] Yes
[X] No

Type of change

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[X] Other... Please describe: Multi-modal samples

DETAILS

The changes include updates to the documentation and code files related to the Phi labs using C#. The `csharplabs.md` and `readme.md` files were enhanced with clearer instructions and additional project descriptions. A new project for multi-modal image processing was added (`LabsPhi4-MultiModal-01Images.csproj`), which utilizes ONNX models for image analysis. The `Program.cs` file was modified to implement image processing and generate responses based on user prompts. Additionally, the project structure in the solution file (`LabsPhi.sln`) was updated to include the new multi-modal project, ensuring proper configuration for building and running within the solution.
DETAILS

This commit introduces a new project called "LabsPhi4-MultiModal-02Audio" that utilizes a local Phi-4 model for audio file analysis and transcription generation. The project includes a new `.csproj` file with the necessary package references, a `Program.cs` file containing the main audio processing logic, and an audio file for testing purposes.

Additionally, the solution file (`LabsPhi.sln`) has been updated to include this new project and its configurations, along with adjustments to existing project configurations. A copyright notice has also been added to the `Program.cs` file.
DETAILS

The changes involve the removal of a project named "LabsPhi4-Chat-03OnnxGenAIAPI" from the solution file "LabsPhi.sln". This includes the deletion of its project configuration settings and any associated build configurations. The project was identified by the GUID "{905C8124-5D16-4417-B171-CBDC991EF992}". Additionally, the project was removed from the nested projects section, and its configurations for both Debug and Release modes were also eliminated from the solution's global settings.
DETAILS

- Updated `LabsPhi.sln` to include `Debug_Cuda` configuration.
- Added multiple build configurations in `LabsPhi4-MultiModal-02Audio.csproj`.
- Modified package references to conditionally include based on configuration.
- Changed model initialization in `Program.cs` to use a `Config` object.
- Ensured proper disposal of resources in `Program.cs`.
@github-actions
Copy link
Contributor

Check Broken URLs

We have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue.

Check the file paths and associated broken URLs inside them.
For more details, check our Contributing Guide.

File Full Path Issues
README.md
#LinkLine Number
1https://huggingface.co/microsoft181
2https://huggingface.co/chat/models/microsoft/Phi-3-mini-4k-instruct184
code/06.E2E/E2E_Phi-3-mini-4k-instruct-Whispser_Demo.ipynb
#LinkLine Number
1https://huggingface.co/settings/tokens57
md/02.Application/01.TextAndChat/Phi3/E2E_Phi-3-mini_with_whisper.md
#LinkLine Number
1https://huggingface.co/settings/tokens80
md/02.Application/01.TextAndChat/Phi3/E2E_Phi-3-FineTuning_PromptFlow_Integration.md
#LinkLine Number
1https://huggingface.co/683
md/03.FineTuning/Finetuning_VSCodeaitoolkit.md
#LinkLine Number
1https://huggingface.co/119
2https://huggingface.co/docs/hub/security-tokens119
3https://huggingface.co/docs/huggingface_hub/package_reference/environment_variables#hftoken146
md/03.FineTuning/FineTuning_Phi-3-visionWandB.md
#LinkLine Number
1https://huggingface.co/datasets/DBQ/Burberry.Product.prices.United.States28
md/03.FineTuning/FineTuning_Lora.md
#LinkLine Number
1https://huggingface.co/microsoft/Phi-3-mini-4k-instruct/blob/main/sample_finetune.py94
md/01.Introduction/04/UsingORTGenAIQuantifyingPhi.md
#LinkLine Number
1https://huggingface.co/microsoft/Phi-3.5-vision-instruct105
2https://huggingface.co/lokinfey/Phi-3.5-vision-instruct-onnx-cpu/resolve/main/onnx/config.json109
3https://huggingface.co/lokinfey/Phi-3.5-vision-instruct-onnx-cpu/blob/main/onnx/image_embedding_phi3_v_for_onnx.py111
4https://huggingface.co/lokinfey/Phi-3.5-vision-instruct-onnx-cpu/blob/main/onnx/modeling_phi3_v.py113
5https://huggingface.co/lokinfey/Phi-3.5-vision-instruct-onnx-cpu/blob/main/onnx/build.py117
md/01.Introduction/04/UsingLlamacppQuantifyingPhi.md
#LinkLine Number
1https://huggingface.co/docs/hub/en/gguf105
md/01.Introduction/02/01.HF.md
#LinkLine Number
1https://huggingface.co/4
2https://huggingface.co/docs/hub/security-tokens33
3https://huggingface.co/settings/tokens33
md/01.Introduction/01/01.Edgeandcloud.md
#LinkLine Number
1https://huggingface.co/microsoft/Phi-3-vision-128k-instruct-onnx-cuda/tree/main12
2https://huggingface.co/microsoft/Phi-3-vision-128k-instruct-onnx-cpu/tree/main12
3https://huggingface.co/microsoft/Phi-3-vision-128k-instruct-onnx-directml/tree/main12
4https://huggingface.co/microsoft/Phi-3-vision-128k-instruct12
5https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-onnx13
6https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-onnx13
7https://huggingface.co/chat/models/microsoft/Phi-3-mini-4k-instruct13
8https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-gguf13
9https://huggingface.co/microsoft/Phi-3-mini-128k-instruct-onnx14
10https://huggingface.co/microsoft/Phi-3-mini-128k-instruct-onnx14
11https://huggingface.co/microsoft/Phi-3-small-8k-instruct-onnx-cuda15
12https://huggingface.co/microsoft/Phi-3-small-8k-instruct-onnx-cuda15
13https://huggingface.co/microsoft/Phi-3-medium-128k-instruct-onnx-cuda16
14https://huggingface.co/microsoft/Phi-3-small-128k-instruct16
15https://huggingface.co/microsoft/Phi-3-medium-4k-instruct17
16https://huggingface.co/microsoft/Phi-3-medium-4k-instruct-onnx-cuda/tree/main17
17https://huggingface.co/microsoft/Phi-3-medium-4k-instruct-onnx-cpu/tree/main17
18https://huggingface.co/microsoft/Phi-3-medium-4k-instruct-onnx-directml/tree/main17
19https://huggingface.co/microsoft/Phi-3-medium-4k-instruct17
20https://huggingface.co/microsoft/Phi-3-medium-128k-instruct-onnx-cuda/tree/main18
21https://huggingface.co/microsoft/Phi-3-medium-128k-instruct-onnx-cpu/tree/main18
22https://huggingface.co/microsoft/Phi-3-medium-128k-instruct-onnx-directml/tree/main18
23https://huggingface.co/microsoft/Phi-3-medium-128k-instruct18
md/01.Introduction/01/01.PhiFamily.md
#LinkLine Number
1https://huggingface.co/microsoft/phi-116
2https://huggingface.co/microsoft/phi-1_517
3https://huggingface.co/microsoft/phi-1_518
4https://huggingface.co/microsoft/Phi-3-mini-4k-instruct19
5https://huggingface.co/microsoft/Phi-3-mini-128k-instruct19
6https://huggingface.co/microsoft/Phi-3-small-8k-instruct20
7https://huggingface.co/microsoft/Phi-3-small-128k-instruct20
8https://huggingface.co/microsoft/Phi-3-medium-4k-instruct21
9https://huggingface.co/microsoft/Phi-3-medium-128k-instruct21
10https://huggingface.co/microsoft/Phi-3-vision-128k-instruct22
11https://huggingface.co/microsoft/Phi-3.5-mini-instruct23
12https://huggingface.co/microsoft/Phi-3.5-MoE-instruct24
13https://huggingface.co/microsoft/Phi-3.5-vision-instruct25
14https://huggingface.co/microsoft/phi-426
15https://huggingface.co/collections/microsoft/phi-1-6626e29134744e94e222d57238
16https://huggingface.co/microsoft/phi-239
17https://huggingface.co/collections/microsoft/phi-3-6626e15e9585a200d2d761e340
18https://huggingface.co/collections/microsoft/phi-4-677e9380e514feb5577a40e441
md/04.HOL/dotnet/readme.md
#LinkLine Number
1https://huggingface.co13

@leestott
Copy link
Contributor

@elbruno you have branch conflicts

@leestott leestott merged commit 55e25b4 into microsoft:main Feb 28, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants