Skip to content

Add basic iOS phi-3 sample #433

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

Merged
merged 16 commits into from
Jun 7, 2024
Merged

Conversation

YUNQIUGUO
Copy link
Contributor

@YUNQIUGUO YUNQIUGUO commented May 22, 2024

Added a basic iOS Phi-3 sample application, achieves the functionality of generating streaming output token by token in the app similarly as for the android Phi-3 app.

TODOs:

  1. Refine App UI (a. add input text box to accept user prompt question (manual hard coded in the ContentView.swift for now). b. Chatbox UI design.)
  2. Potential README.md doc updates.

Partially referenced from this project: https://github.com/Azure-Samples/Phi-3MiniSamples/tree/main/ios


Usually the build output path for libonnxruntime.dylib is under `<ORT_PROJECT_ROOT>/build/intermediates/<platform>_<arch>/<build_config>/<build_config-platform>/libonnxruntime.dylib` and the build output path for libonnxruntime-genai.dylib is under `<ORT_GENAI_PROJECT_ROOT>/build/<build_config-platform>/libonnxruntime-genai.dylib`. For example:
it may look like: `onnxruntime/build/intermediates/iphoneos_arm64/Release/Release-iphoneos/libonnxruntime.1.19.0.dylib`
and similarly `onnxruntime-genai/build/Release/Release-iphoneos/libonnxruntime-genai.dylib`.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: We need to fix the genai ios build to include the architecture in the output path.

Copy link
Contributor Author

@YUNQIUGUO YUNQIUGUO Jun 7, 2024

Choose a reason for hiding this comment

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

right good catch.. - forgot how xcode generate those path, but possibly a build variable is not correctly read for "ARCHS"

@YUNQIUGUO YUNQIUGUO merged commit 0de2e66 into main Jun 7, 2024
18 of 26 checks passed
@YUNQIUGUO YUNQIUGUO deleted the yguo/ios-sample-phi3-contentview branch June 7, 2024 20:43
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.

3 participants