Skip to content

Commit

Permalink
v1.2.3 (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
matt200-ok authored Dec 23, 2024
1 parent cdba56c commit 1c96e3e
Show file tree
Hide file tree
Showing 52 changed files with 300 additions and 409 deletions.
16 changes: 2 additions & 14 deletions .github/workflows/ios-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install Cocoapods
run: gem install cocoapods

- name: Run Cocoapods
run: pod install --repo-update

- name: Build
run: xcrun xcodebuild build
-configuration Debug
-workspace PicoLLMCompletionDemo.xcworkspace
-project PicoLLMCompletionDemo.xcodeproj
-sdk iphoneos
-scheme PicoLLMCompletionDemo
-derivedDataPath ddp
Expand All @@ -51,16 +45,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install Cocoapods
run: gem install cocoapods

- name: Run Cocoapods
run: pod install --repo-update

- name: Build
run: xcrun xcodebuild build
-configuration Debug
-workspace PicoLLMChatDemo.xcworkspace
-project PicoLLMChatDemo.xcodeproj
-sdk iphoneos
-scheme PicoLLMChatDemo
-derivedDataPath ddp
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/ios-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Run Cocoapods
run: pod install --repo-update

- name: Inject AccessKey
run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:'
PicoLLMAppTestUITests/BaseTest.swift
Expand All @@ -42,14 +39,14 @@ jobs:
- name: XCode Build
run: xcrun xcodebuild build-for-testing
-configuration Debug
-workspace PicoLLMAppTest.xcworkspace
-project PicoLLMAppTest.xcodeproj
-sdk iphoneos
-scheme PicoLLMAppTest
-derivedDataPath ddp
CODE_SIGNING_ALLOWED=NO

- name: Run Tests on Simulator
run: xcrun xcodebuild test
-workspace PicoLLMAppTest.xcworkspace
-project PicoLLMAppTest.xcodeproj
-scheme PicoLLMAppTest
-destination 'platform=iOS Simulator,name=iPhone 13,OS=16.4'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
__pycache__
*.bin
*.pllm
.build
Package.resolved
.swiftpm
34 changes: 34 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "picoLLM-iOS",
platforms: [
.iOS(.v13)
],
products: [
.library(
name: "PicoLLM",
targets: ["PicoLLM"]
)
],
targets: [
.binaryTarget(
name: "PvPicoLLM",
path: "lib/ios/PvPicoLLM.xcframework"
),
.target(
name: "PicoLLM",
dependencies: ["PvPicoLLM"],
path: ".",
exclude: [
"binding/ios/PicoLLMAppTest",
"demo"
],
sources: [
"binding/ios/PicoLLM.swift",
"binding/ios/PicoLLMDialog.swift",
"binding/ios/PicoLLMErrors.swift"
]
)
]
)
2 changes: 1 addition & 1 deletion binding/android/PicoLLM/picollm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'

ext {
PUBLISH_GROUP_ID = 'ai.picovoice'
PUBLISH_VERSION = '1.2.2'
PUBLISH_VERSION = '1.2.3'
PUBLISH_ARTIFACT_ID = 'picollm-android'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public class PicoLLM {
DIALOGS.put("llama-2-70b-chat", Llama2ChatDialog.class);
DIALOGS.put("llama-3-8b-instruct", Llama3ChatDialog.class);
DIALOGS.put("llama-3-70b-instruct", Llama3ChatDialog.class);
DIALOGS.put("llama-3.2-1b-instruct", Llama32ChatDialog.class);
DIALOGS.put("llama-3.2-3b-instruct", Llama32ChatDialog.class);
DIALOGS.put("mistral-7b-instruct-v0.1", MistralChatDialog.class);
DIALOGS.put("mistral-7b-instruct-v0.2", MistralChatDialog.class);
DIALOGS.put("mixtral-8x7b-instruct-v0.1", MixtralChatDialog.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
Copyright 2024 Picovoice Inc.
You may not use this file except in compliance with the license. A copy of the license is
located in the "LICENSE" file accompanying this source.
Unless required by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the specific language governing permissions and
limitations under the License.
*/

package ai.picovoice.picollm;

/**
* Represents a dialog helper specific for the `phi3.5` model.
*/
public class Llama32ChatDialog extends Llama3ChatDialog {

/**
* Builder class for constructing Llama32ChatDialog instances.
*/
public static class Builder extends PicoLLMDialog.Builder {
/**
* Builds a new instance of Llama32ChatDialog based on the configured settings.
*
* @return A new instance of Llama32ChatDialog.
*/
public Llama32ChatDialog build() {
return new Llama32ChatDialog(this.history, this.system);
}
}

/**
* Constructs a Llama32ChatDialog instance with the specified history and system settings.
*
* @param history The history length for the dialog.
* @param system The system instruction for configuring the model's responses.
*/
Llama32ChatDialog(Integer history, String system) {
super(history, system);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.code.gson:gson:2.10'

implementation 'ai.picovoice:picollm-android:1.2.2'
implementation 'ai.picovoice:picollm-android:1.2.3'

// Espresso UI Testing
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import ai.picovoice.picollm.GemmaChatDialog;
import ai.picovoice.picollm.Llama2ChatDialog;
import ai.picovoice.picollm.Llama3ChatDialog;
import ai.picovoice.picollm.Llama32ChatDialog;
import ai.picovoice.picollm.MistralChatDialog;
import ai.picovoice.picollm.Phi2ChatDialog;
import ai.picovoice.picollm.Phi2QADialog;
Expand Down Expand Up @@ -672,6 +673,8 @@ public PicoLLMDialog.Builder getDialogBuilder(String dialogName) {
return new Llama2ChatDialog.Builder();
case "llama-3-chat-dialog":
return new Llama3ChatDialog.Builder();
case "llama-3.2-chat-dialog":
return new Llama32ChatDialog.Builder();
case "mistral-chat-dialog":
return new MistralChatDialog.Builder();
case "phi2-chat-dialog":
Expand Down
2 changes: 2 additions & 0 deletions binding/ios/PicoLLM.swift
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,8 @@ public class PicoLLM {
"llama-2-70b-chat": Llama2ChatDialog.self,
"llama-3-8b-chat": Llama3ChatDialog.self,
"llama-3-70b-chat": Llama3ChatDialog.self,
"llama-3.2-1b-chat": Llama32ChatDialog.self,
"llama-3.2-3b-chat": Llama32ChatDialog.self,
"mistral-7b-instruct-v0.1": MistralChatDialog.self,
"mistral-7b-instruct-v0.2": MistralChatDialog.self,
"mixtral-8x7b-instruct-v0.1": MixtralChatDialog.self,
Expand Down
Loading

0 comments on commit 1c96e3e

Please sign in to comment.