Skip to content

Update iOS LLM Application #505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

vraspar
Copy link
Contributor

@vraspar vraspar commented Dec 18, 2024

  • Update App to use new GenAI API
  • Add ability to select model path from app to allow using multiple models in single build

@vraspar vraspar force-pushed the vraspar/llm-ios-app-update branch from a6c98fc to 6102533 Compare December 18, 2024 12:29
@vraspar vraspar requested a review from Copilot December 18, 2024 12:32
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 3 out of 7 changed files in this pull request and generated no comments.

Files not reviewed (4)
  • mobile/examples/phi-3/ios/LocalLLM/LocalLLM/ContentView.swift: Language not supported
  • mobile/examples/phi-3/ios/LocalLLM/LocalLLM/FolderPicker.swift: Language not supported
  • mobile/examples/phi-3/ios/LocalLLM/LocalLLM/GenAIGenerator.h: Language not supported
  • mobile/examples/phi-3/ios/LocalLLM/LocalLLM/GenAIGenerator.mm: Language not supported

@vraspar vraspar requested a review from edgchen1 December 19, 2024 09:27
@vraspar vraspar marked this pull request as ready for review April 15, 2025 23:54
@@ -405,8 +422,10 @@
"$(PROJECT_DIR)/LocalLLM/lib",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = ai.onnxruntime.genai.demo.LocalLLM;
"MTL_ENABLE_DEBUG_INFO[sdk=iphoneos*]" = "";
PRODUCT_BUNDLE_IDENTIFIER = ai.onnxruntime.genai.demo.LocalLL;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the change to PRODUCT_BUNDLE_IDENTIFIER intentional? also on line 471.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need the onnxruntime header? it looks like GenAIGenerator.mm only uses the onnxruntime-genai headers.

@@ -7,12 +7,12 @@
#include "ort_genai.h"
#include "ort_genai_c.h"


const size_t kMaxTokens = 200;
const size_t kMaxTokens = 64;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it only 64?

@synchronized(self) {
self->modelPath = [modelPath copy];
NSLog(@"Model folder path set to: %@", modelPath);
[self loadModelFromPath];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we ensure that C++ exceptions don't leave this scope?


auto generator = OgaGenerator::Create(*self->model, *params);

bool isFirstToken = true;
NSLog(@"Starting token generation loop...");

startTime = Clock::now();
firstTokenTime = Clock::now();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why set it to the current time?

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.

None yet

2 participants