Skip to content

Commit

Permalink
v1.2 (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
matt200-ok authored Nov 14, 2024
1 parent 3a03412 commit 48d2914
Show file tree
Hide file tree
Showing 105 changed files with 422 additions and 252 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: ~/Android/Sdk/platform-tools/adb shell pm uninstall ai.picovoice.picollm.testapp.test || true

- name: Download resource files
run: curl http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/03-280e68c/phi2-290.pllm -o phi2-290.pllm
run: curl http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/04-d5f2aa0/phi2-290.pllm -o phi2-290.pllm

- name: Make Android dir
run: ~/Android/Sdk/platform-tools/adb shell mkdir -p /sdcard/Android/data/ai.picovoice.picollm.testapp/files/external
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
run: ~/Android/Sdk/platform-tools/adb shell pm uninstall ai.picovoice.picollm.testapp.test || true

- name: Download resource files
run: curl http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/03-280e68c/phi2-290.pllm -o phi2-290.pllm
run: curl http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/04-d5f2aa0/phi2-290.pllm -o phi2-290.pllm

- name: Make Android dir
run: ~/Android/Sdk/platform-tools/adb shell mkdir -p /sdcard/Android/data/ai.picovoice.picollm.testapp/files/external
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/c-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,29 @@ jobs:
- xpu: cpu
machine: pv-windows
make_file: "MinGW Makefiles"
- xpu: gpu
machine: pv-windows-igpu
make_file: "MinGW Makefiles"

steps:
- uses: actions/checkout@v3

- name: Setup Python virtualenv (*nix)
if: ${{ matrix.machine != 'pv-windows' }}
if: ${{ matrix.machine != 'pv-windows' && matrix.machine != 'pv-windows-igpu' }}
run: |
python3 -m venv binding/python/.venv
. binding/python/.venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Setup Python virtualenv (windows)
if: ${{ matrix.machine == 'pv-windows' }}
if: ${{ matrix.machine == 'pv-windows' || matrix.machine == 'pv-windows-igpu' }}
run: |
python3 -m venv binding\python\.venv
python3 -m venv binding\python\.venv --symlinks
binding\python\.venv\Scripts\activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Download resource files
run: curl http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/03-280e68c/phi2-290.pllm -o phi2-290.pllm
run: curl http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/04-d5f2aa0/phi2-290.pllm -o phi2-290.pllm

- name: Create build directory
run: cmake -G "${{ matrix.make_file }}" -B ./build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
PicoLLMAppTestUITests/BaseTest.swift

- name: Inject Resource URL
run: sed -i '.bak' 's?{TESTING_MODEL_URL_HERE}?http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/03-280e68c/phi2-290.pllm?'
run: sed -i '.bak' 's?{TESTING_MODEL_URL_HERE}?http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/04-d5f2aa0/phi2-290.pllm?'
PicoLLMAppTestUITests/BaseTest.swift

- name: XCode Build
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/nodejs-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
machine: pv-linux
- xpu: gpu
machine: pv-windows
- xpu: gpu
machine: pv-windows-igpu

steps:
- uses: actions/checkout@v3
Expand All @@ -49,7 +51,7 @@ jobs:
run: yarn install

- name: Download resource files
run: curl http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/03-280e68c/phi2-290.pllm -o phi2-290.pllm
run: curl http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/04-d5f2aa0/phi2-290.pllm -o phi2-290.pllm

- name: Test
run: yarn completion --access_key ${{secrets.PV_VALID_ACCESS_KEY}} --model_path phi2-290.pllm --completion_token_limit 10 --prompt "Hello my name is" --device ${{matrix.xpu}}
4 changes: 3 additions & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
machine: pv-linux
- xpu: gpu
machine: pv-windows
- xpu: gpu
machine: pv-windows-igpu

steps:
- uses: actions/checkout@v3
Expand All @@ -46,7 +48,7 @@ jobs:
run: yarn install

- name: Download resource files
run: curl http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/03-280e68c/phi2-290.pllm -o test/phi2-290.pllm
run: curl http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/04-d5f2aa0/phi2-290.pllm -o test/phi2-290.pllm

- name: Test
run: yarn test test/index.test.ts --access_key=${{secrets.PV_VALID_ACCESS_KEY}} --device=${{matrix.xpu}}
10 changes: 6 additions & 4 deletions .github/workflows/python-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,30 @@ jobs:
machine: pv-linux
- xpu: gpu
machine: pv-windows
- xpu: gpu
machine: pv-windows-igpu
steps:
- uses: actions/checkout@v3

- name: Setup Python virtualenv (*nix)
if: ${{ matrix.machine != 'pv-windows' }}
if: ${{ matrix.machine != 'pv-windows' && matrix.machine != 'pv-windows-igpu' }}
run: |
python3 -m venv .venv
. .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Setup Python virtualenv (windows)
if: ${{ matrix.machine == 'pv-windows' }}
if: ${{ matrix.machine == 'pv-windows' || matrix.machine == 'pv-windows-igpu' }}
run: |
python3 -m venv .venv
python3 -m venv .venv --symlinks
.venv\Scripts\activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Install Python dependencies
run: python3 -m pip install -r requirements.txt

- name: Download resource files
run: curl http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/03-280e68c/phi2-290.pllm -o phi2-290.pllm
run: curl http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/04-d5f2aa0/phi2-290.pllm -o phi2-290.pllm

- name: Test
run: python3 picollm_demo_completion.py --access_key ${{secrets.PV_VALID_ACCESS_KEY}} --model_path phi2-290.pllm --completion_token_limit 10 --prompt "Hello my name is" --device ${{matrix.xpu}}
10 changes: 6 additions & 4 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,30 @@ jobs:
machine: pv-linux
- xpu: gpu
machine: pv-windows
- xpu: gpu
machine: pv-windows-igpu
steps:
- uses: actions/checkout@v3

- name: Setup Python virtualenv (*nix)
if: ${{ matrix.machine != 'pv-windows' }}
if: ${{ matrix.machine != 'pv-windows' && matrix.machine != 'pv-windows-igpu' }}
run: |
python3 -m venv binding/python/.venv
. binding/python/.venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Setup Python virtualenv (windows)
if: ${{ matrix.machine == 'pv-windows' }}
if: ${{ matrix.machine == 'pv-windows' || matrix.machine == 'pv-windows-igpu' }}
run: |
python3 -m venv binding\python\.venv
python3 -m venv binding\python\.venv --symlinks
binding\python\.venv\Scripts\activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Install Python dependencies
run: python3 -m pip install -r binding/python/requirements.txt

- name: Download resource files
run: curl http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/03-280e68c/phi2-290.pllm -o phi2-290.pllm
run: curl http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/04-d5f2aa0/phi2-290.pllm -o phi2-290.pllm

- name: Test
run: python3 -m binding.python.test_picollm ${{secrets.PV_VALID_ACCESS_KEY}} ./phi2-290.pllm ${{matrix.xpu}}
2 changes: 0 additions & 2 deletions .github/workflows/web-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ jobs:
steps:
- uses: actions/checkout@v3

#### REMOVE AFTER RELEASE ####

- name: Install dependencies
run: yarn install

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: yarn build

- name: Prepare Test
run: yarn setup-test http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/03-280e68c/phi2-290.pllm phi2-290.pllm
run: yarn setup-test http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.pllm/04-d5f2aa0/phi2-290.pllm phi2-290.pllm

- name: Test Web Worker
run: yarn test --env ACCESS_KEY=${{secrets.PV_VALID_ACCESS_KEY}}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,11 @@ pv_picollm_delete(pllm);

## Releases

### v1.2.0 - November 14th, 2024

- Performance improvements
- Added support for phi3.5

### v1.1.0 - October 1st, 2024

- Added `interrupt()` function for halting completion generation early
Expand Down
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.1.0'
PUBLISH_VERSION = '1.2.0'
PUBLISH_ARTIFACT_ID = 'picollm-android'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class PicoLLM {
phi2Map.put("chat", Phi2ChatDialog.class);
DIALOGS.put("phi2", phi2Map);
DIALOGS.put("phi3", Phi3ChatDialog.class);
DIALOGS.put("phi3.5", Phi35ChatDialog.class);
}

public static void setSdk(String sdk) {
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 Phi35ChatDialog extends Phi3ChatDialog {

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

/**
* Constructs a Phi35ChatDialog 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.
*/
Phi35ChatDialog(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.1.0'
implementation 'ai.picovoice:picollm-android:1.2.0'

// 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 @@ -50,6 +50,7 @@
import ai.picovoice.picollm.Phi2ChatDialog;
import ai.picovoice.picollm.Phi2QADialog;
import ai.picovoice.picollm.Phi3ChatDialog;
import ai.picovoice.picollm.Phi35ChatDialog;
import ai.picovoice.picollm.PicoLLM;
import ai.picovoice.picollm.PicoLLMCompletion;
import ai.picovoice.picollm.PicoLLMDialog;
Expand Down Expand Up @@ -679,6 +680,8 @@ public PicoLLMDialog.Builder getDialogBuilder(String dialogName) {
return new Phi2QADialog.Builder();
case "phi3-chat-dialog":
return new Phi3ChatDialog.Builder();
case "phi3.5-chat-dialog":
return new Phi35ChatDialog.Builder();
default:
return null;
}
Expand Down
2 changes: 2 additions & 0 deletions binding/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ picoLLM Inference Engine supports the following open-weight models. The models a
- `phi2`
- Phi-3
- `phi3`
- Phi-3.5
- `phi3.5`

### Model File Deployment

Expand Down
3 changes: 2 additions & 1 deletion binding/ios/PicoLLM.swift
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,8 @@ public class PicoLLM {
"mistral-7b-instruct-v0.1": MistralChatDialog.self,
"mistral-7b-instruct-v0.2": MistralChatDialog.self,
"mixtral-8x7b-instruct-v0.1": MixtralChatDialog.self,
"phi3": Phi3ChatDialog.self
"phi3": Phi3ChatDialog.self,
"phi3.5": Phi35ChatDialog.self
]

private static let phi2Dialogs: [String: Phi2Dialog.Type] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,8 @@ class PicoLLMAppTestUITests: BaseTest {
"mistral-chat-dialog": MistralChatDialog.self,
"phi2-chat-dialog": Phi2ChatDialog.self,
"phi2-qa-dialog": Phi2QADialog.self,
"phi3-chat-dialog": Phi3ChatDialog.self
"phi3-chat-dialog": Phi3ChatDialog.self,
"phi3.5-chat-dialog": Phi35ChatDialog.self
]
let dialogPrompts = self.dialogTestData![testName] as! [String: String]
let conversation = self.dialogTestData!["conversation"] as! [[String]]
Expand Down
4 changes: 2 additions & 2 deletions binding/ios/PicoLLMAppTest/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ source 'https://cdn.cocoapods.org/'
platform :ios, '16.0'

target 'PicoLLMAppTest' do
pod 'picoLLM-iOS', '~> 1.1.0'
pod 'picoLLM-iOS', '~> 1.2.0'
end

target 'PicoLLMAppTestUITests' do
pod 'picoLLM-iOS', '~> 1.1.0'
pod 'picoLLM-iOS', '~> 1.2.0'
end
10 changes: 5 additions & 5 deletions binding/ios/PicoLLMAppTest/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
PODS:
- picoLLM-iOS (1.1.0)
- picoLLM-iOS (1.2.0)

DEPENDENCIES:
- picoLLM-iOS (~> 1.1.0)
- picoLLM-iOS (~> 1.2.0)

SPEC REPOS:
trunk:
- picoLLM-iOS

SPEC CHECKSUMS:
picoLLM-iOS: dc03cd7e992c702ff34c667f9a35dd9a8084c061
picoLLM-iOS: 9ff6baa0b9e577d99491f4fa63f898a16fc6925c

PODFILE CHECKSUM: 98abf1cf0742d4b39a907fca5738e5c82a67bf5a
PODFILE CHECKSUM: 0fc8e4e6c396032024417ef0a8a5b036c1d24c70

COCOAPODS: 1.11.3
COCOAPODS: 1.15.2
5 changes: 5 additions & 0 deletions binding/ios/PicoLLMDialog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ public class Phi3ChatDialog: BasePicoLLMDialog {
}
}

/// Dialog helper for `phi3.5`.
public class Phi35ChatDialog: Phi3ChatDialog {

}

/// Dialog helper for `mistral-7b-instruct-v0.1` and `mistral-7b-instruct-v0.2`.
public class MistralChatDialog: BasePicoLLMDialog {
public override func prompt() throws -> String {
Expand Down
2 changes: 2 additions & 0 deletions binding/ios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ picoLLM Inference Engine supports the following open-weight models. The models a
- `phi2`
- Phi-3
- `phi3`
- Phi-3.5
- `phi3.5`

### Model File Deployment

Expand Down
4 changes: 2 additions & 2 deletions binding/ios/picoLLM-iOS.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = 'picoLLM-iOS'
s.module_name = 'PicoLLM'
s.version = '1.1.0'
s.version = '1.2.0'
s.license = {:type => 'Apache 2.0'}
s.summary = 'picoLLM Inference Engine'
s.description =
Expand All @@ -10,7 +10,7 @@ Pod::Spec.new do |s|
DESC
s.homepage = 'https://github.com/Picovoice/picollm/tree/master/binding/ios'
s.author = { 'Picovoice' => '[email protected]' }
s.source = { :git => "https://github.com/Picovoice/picollm.git", :tag => "picoLLM-iOS-v1.1.0" }
s.source = { :git => "https://github.com/Picovoice/picollm.git", :tag => "picoLLM-iOS-v1.2.0" }
s.ios.deployment_target = '16.0'
s.swift_version = '5.0'
s.vendored_frameworks = 'lib/ios/PvPicoLLM.xcframework'
Expand Down
2 changes: 2 additions & 0 deletions binding/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ picoLLM Inference Engine supports the following open-weight models. The models a
- `phi2`
- Phi-3
- `phi3`
- Phi-3.5
- `phi3.5`

## AccessKey

Expand Down
Loading

0 comments on commit 48d2914

Please sign in to comment.