-
Notifications
You must be signed in to change notification settings - Fork 362
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
base: main
Are you sure you want to change the base?
Conversation
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
a6c98fc
to
6102533
Compare
There was a problem hiding this 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
@@ -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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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?