Skip to content

How to load a local QNN model using C #? #225

@nnbw-liu

Description

@nnbw-liu

I successfully loaded and ran the QNN model converted from VSCode in cmd according to the tutorial.

Foundry Local 的最佳做法和故障排除指南

Image

I obtained the model list using C # code but couldn't find the model I wanted.
Image


                    foundryLocalManager = new FoundryLocalManager();
                    if (!foundryLocalManager.IsServiceRunning)
                    {
                        await foundryLocalManager.StartServiceAsync();
                    }
                    var list = await foundryLocalManager.ListCatalogModelsAsync();
                    var list1 = await foundryLocalManager.ListCachedModelsAsync();
                    var list2 = await foundryLocalManager.ListLoadedModelsAsync();
                    modelInfo = await foundryLocalManager.GetModelInfoAsync(aliasOrModelId: modelId);
                    ApiKeyCredential key = new ApiKeyCredential(foundryLocalManager.ApiKey);
                    client = new OpenAIClient(key, new OpenAIClientOptions
                    {
                        Endpoint = foundryLocalManager.Endpoint
                    });
                    chatClient = client.GetChatClient(modelInfo?.ModelId);

How do I load the local model?

AB#76094

Metadata

Metadata

Assignees

No one assigned

    Labels

    ADObugSomething isn't workingduplicateThis issue or pull request already existspapercutThis issue relates to user experience papercut

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions