-
Notifications
You must be signed in to change notification settings - Fork 372
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
mobile/examples/phi-3/ios/LocalLLM/LocalLLM.xcodeproj/project.pbxproj
Outdated
Show resolved
Hide resolved
mobile/examples/phi-3/ios/LocalLLM/LocalLLM/header/onnxruntime_c_api.h
Outdated
Show resolved
Hide resolved
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.
can this file have a more meaningful name?
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.
where is this file used?
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ | ||
8AC409CD2DADE0EC00388525 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { | ||
isa = PBXFileSystemSynchronizedBuildFileExceptionSet; | ||
membershipExceptions = ( | ||
"LLama-3.2-1B-int4-acc_4-gqa-webgpu-fp16/genai_config.json", | ||
"LLama-3.2-1B-int4-acc_4-gqa-webgpu-fp16/model.onnx", | ||
"LLama-3.2-1B-int4-acc_4-gqa-webgpu-fp16/model.onnx.data", | ||
"LLama-3.2-1B-int4-acc_4-gqa-webgpu-fp16/special_tokens_map.json", | ||
"LLama-3.2-1B-int4-acc_4-gqa-webgpu-fp16/tokenizer_config.json", | ||
"LLama-3.2-1B-int4-acc_4-gqa-webgpu-fp16/tokenizer.json", | ||
); | ||
target = 51D4C8D12BFD22D70029FCEA /* LocalLLM */; | ||
}; | ||
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ |
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.
what's this section for? looks like it specifies llama3.2 specific files
@@ -441,8 +467,9 @@ | |||
"$(PROJECT_DIR)/LocalLLM/lib", | |||
); | |||
MARKETING_VERSION = 1.0; | |||
PRODUCT_BUNDLE_IDENTIFIER = ai.onnxruntime.genai.demo.LocalLLM; | |||
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.
the identifier probably doesn't need to change
@@ -30,27 +30,48 @@ - (instancetype)init { | |||
return self; | |||
} | |||
|
|||
- (void)setModelFolderPath:(NSString*)modelPath { | |||
@synchronized(self) { |
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 also synchronize access to self->model
and self->tokenizer
from generate
? I'm not sure this is the right level that we should be synchronizing at. is there a way we can ensure that generate
and setModelFolderPath
don't get called at the same time?
perhaps the constructor can take the model path and we just create a new GenAIGenerator
if the model path changes?