Skip to content
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

v1.2.3 #76

Merged
merged 7 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/nodejs-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

# ************ REMOVE AFTER RELEASE ***************
- name: build local binding
run: yarn install && yarn build
working-directory: binding/nodejs
# ************ REMOVE AFTER RELEASE ***************

- name: Install dependencies
run: yarn install

Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/python-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ jobs:
.venv\Scripts\activate
echo PATH=$PATH >> $GITHUB_ENV

# ************ REMOVE AFTER RELEASE ***************
- name: build local binding
run: |
python3 -m pip install setuptools wheel
python3 -m setup sdist bdist_wheel
working-directory: binding/python
# ************ REMOVE AFTER RELEASE ***************

- name: Install Python dependencies
run: python3 -m pip install -r requirements.txt

Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/web-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ jobs:
steps:
- uses: actions/checkout@v3

# ************ REMOVE AFTER RELEASE ***************
- name: build local binding
run: yarn install && yarn copywasm && yarn build
working-directory: binding/web
# ************ REMOVE AFTER RELEASE ***************

- name: Install dependencies
run: yarn install

Expand All @@ -43,5 +49,11 @@ jobs:
steps:
- uses: actions/checkout@v3

# ************ REMOVE AFTER RELEASE ***************
- name: build local binding
run: yarn install && yarn copywasm && yarn build
working-directory: binding/web
# ************ REMOVE AFTER RELEASE ***************

- name: Install dependencies
run: yarn install
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);
}
}
6 changes: 6 additions & 0 deletions binding/android/PicoLLMTestApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ buildscript {
repositories {
google()
mavenCentral()
maven {
url 'https://s01.oss.sonatype.org/content/repositories/aipicovoice-1358/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
Expand All @@ -21,6 +24,9 @@ allprojects {
repositories {
google()
mavenCentral()
maven {
url 'https://s01.oss.sonatype.org/content/repositories/aipicovoice-1358/'
}
}
}

Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ class PicoLLMAppTestUITests: BaseTest {
"gemma-chat-dialog": GemmaChatDialog.self,
"llama-2-chat-dialog": Llama2ChatDialog.self,
"llama-3-chat-dialog": Llama3ChatDialog.self,
"llama-3.2-chat-dialog": Llama32ChatDialog.self,
"mistral-chat-dialog": MistralChatDialog.self,
"phi2-chat-dialog": Phi2ChatDialog.self,
"phi2-qa-dialog": Phi2QADialog.self,
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.2.2'
pod 'picoLLM-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/picollm/refs/heads/v1.2.3/binding/ios/picoLLM-iOS.podspec'
end

target 'PicoLLMAppTestUITests' do
pod 'picoLLM-iOS', '~> 1.2.2'
pod 'picoLLM-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/picollm/refs/heads/v1.2.3/binding/ios/picoLLM-iOS.podspec'
end
5 changes: 5 additions & 0 deletions binding/ios/PicoLLMDialog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ public class Llama3ChatDialog: BasePicoLLMDialog {
}
}

/// Dialog helper for `llama-3.2-1b-instruct` and `llama-3.2-3b-instruct`.
public class Llama32ChatDialog: Llama3ChatDialog {

}

/// Dialog helper for `gemma-2b-it` and `gemma-7b-it`.
public class GemmaChatDialog: BasePicoLLMDialog {
public override func prompt() throws -> String {
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.2.2'
s.version = '1.2.3'
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.2.2" }
s.source = { :git => "https://github.com/Picovoice/picollm.git", :tag => "picoLLM-iOS-v1.2.3" }
s.ios.deployment_target = '16.0'
s.swift_version = '5.0'
s.vendored_frameworks = 'lib/ios/PvPicoLLM.xcframework'
Expand Down
2 changes: 1 addition & 1 deletion binding/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@picovoice/picollm-node",
"version": "1.2.2",
"version": "1.2.3",
"description": "Picovoice picoLLM Node.js binding",
"main": "dist/index.js",
"types": "dist/types/index.d.ts",
Expand Down
9 changes: 9 additions & 0 deletions binding/nodejs/src/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ export class Llama3ChatDialog extends Dialog {
}
}

/**
* Dialog helper for `llama-3.2-1b-instruct` and `llama-3.2-3b-instruct`.
*/
export class Llama32ChatDialog extends Llama3ChatDialog {

}

/**
* Dialog helper for `mistral-7b-instruct-v0.1` and `mistral-7b-instruct-v0.2`.
*/
Expand Down Expand Up @@ -273,6 +280,8 @@ export const DIALOGS: { [key: string]: typeof Dialog | { [key: string]: typeof D
'llama-2-70b-chat': Llama2ChatDialog,
'llama-3-8b-instruct': Llama3ChatDialog,
'llama-3-70b-instruct': Llama3ChatDialog,
'llama-3.2-1b-instruct': Llama32ChatDialog,
'llama-3.2-3b-instruct': Llama32ChatDialog,
'mistral-7b-instruct-v0.1': MistralChatDialog,
'mistral-7b-instruct-v0.2': MistralChatDialog,
'mixtral-8x7b-instruct-v0.1': MixtralChatDialog,
Expand Down
2 changes: 2 additions & 0 deletions binding/nodejs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
GemmaChatDialog,
Llama2ChatDialog,
Llama3ChatDialog,
Llama32ChatDialog,
MistralChatDialog,
MixtralChatDialog,
Phi2Dialog,
Expand All @@ -58,6 +59,7 @@ export {
GemmaChatDialog,
Llama2ChatDialog,
Llama3ChatDialog,
Llama32ChatDialog,
MistralChatDialog,
MixtralChatDialog,
Phi2Dialog,
Expand Down
3 changes: 3 additions & 0 deletions binding/nodejs/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
GemmaChatDialog,
Llama2ChatDialog,
Llama3ChatDialog,
Llama32ChatDialog,
MistralChatDialog,
Phi2ChatDialog,
Phi2QADialog,
Expand Down Expand Up @@ -46,6 +47,7 @@ const DIALOG_CLASSES: { [key: string]: typeof Dialog } = {
'gemma-chat-dialog': GemmaChatDialog,
"llama-2-chat-dialog": Llama2ChatDialog,
"llama-3-chat-dialog": Llama3ChatDialog,
"llama-3.2-chat-dialog": Llama32ChatDialog,
"mistral-chat-dialog": MistralChatDialog,
'phi2-chat-dialog': Phi2ChatDialog,
'phi2-qa-dialog': Phi2QADialog,
Expand All @@ -65,6 +67,7 @@ type DialogExpectations = {
'gemma-chat-dialog': string,
"llama-2-chat-dialog": string,
"llama-3-chat-dialog": string,
"llama-3.2-chat-dialog": string,
"mistral-chat-dialog": string,
'phi2-chat-dialog': string,
'phi2-qa-dialog': string,
Expand Down
12 changes: 12 additions & 0 deletions binding/python/_picollm.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,15 @@ def prompt(self) -> str:
return ''.join(res)


class Llama32ChatDialog(Llama3ChatDialog):
"""
Dialog helper for `llama-3.2-1b-instruct` and `llama-3.2-3b-instruct`.
"""

def __init__(self, history: Optional[int] = None, system: Optional[str] = None) -> None:
super().__init__(history=history, system=system)


class MistralChatDialog(Dialog):
"""
Dialog helper for `mistral-7b-instruct-v0.1` and `mistral-7b-instruct-v0.2`.
Expand Down Expand Up @@ -975,6 +984,8 @@ def get_error_stack(self) -> Sequence[str]:
'llama-2-70b-chat': Llama2ChatDialog,
'llama-3-8b-instruct': Llama3ChatDialog,
'llama-3-70b-instruct': Llama3ChatDialog,
'llama-3.2-1b-instruct': Llama32ChatDialog,
'llama-3.2-3b-instruct': Llama32ChatDialog,
'mistral-7b-instruct-v0.1': MistralChatDialog,
'mistral-7b-instruct-v0.2': MistralChatDialog,
'mixtral-8x7b-instruct-v0.1': MixtralChatDialog,
Expand Down Expand Up @@ -1034,6 +1045,7 @@ def get_dialog(
'GemmaChatDialog',
'Llama2ChatDialog',
'Llama3ChatDialog',
'Llama32ChatDialog',
'MistralChatDialog',
'MixtralChatDialog',
'Phi2ChatDialog',
Expand Down
2 changes: 1 addition & 1 deletion binding/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

setuptools.setup(
name="picollm",
version="1.2.2",
version="1.2.3",
author="Picovoice",
author_email="[email protected]",
description="picoLLM Inference Engine",
Expand Down
2 changes: 2 additions & 0 deletions binding/python/test_picollm.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
GemmaChatDialog,
Llama2ChatDialog,
Llama3ChatDialog,
Llama32ChatDialog,
MistralChatDialog,
Phi2ChatDialog,
Phi2QADialog,
Expand Down Expand Up @@ -466,6 +467,7 @@ def setUpClass(cls) -> None:
"gemma-chat-dialog": GemmaChatDialog,
"llama-2-chat-dialog": Llama2ChatDialog,
"llama-3-chat-dialog": Llama3ChatDialog,
"llama-3.2-chat-dialog": Llama32ChatDialog,
"mistral-chat-dialog": MistralChatDialog,
"phi2-chat-dialog": Phi2ChatDialog,
"phi2-qa-dialog": Phi2QADialog,
Expand Down
2 changes: 1 addition & 1 deletion binding/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "picoLLM Inference Engine is a highly accurate and cross-platform SDK optimized for running compressed large language models.",
"author": "Picovoice Inc",
"license": "Apache-2.0",
"version": "1.2.2",
"version": "1.2.3",
"keywords": [
"web",
"ai",
Expand Down
9 changes: 9 additions & 0 deletions binding/web/src/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ export class Llama3ChatDialog extends Dialog {
}
}

/**
* Dialog helper for `llama-3.2-1b-instruct` and `llama-3.2-3b-instruct`.
*/
export class Llama32ChatDialog extends Llama3ChatDialog {

}

/**
* Dialog helper for `mistral-7b-instruct-v0.1` and `mistral-7b-instruct-v0.2`.
*/
Expand Down Expand Up @@ -272,6 +279,8 @@ export const DIALOGS: { [key: string]: typeof Dialog | { [key: string]: typeof D
'llama-2-70b-chat': Llama2ChatDialog,
'llama-3-8b-instruct': Llama3ChatDialog,
'llama-3-70b-instruct': Llama3ChatDialog,
'llama-3.2-1b-instruct': Llama32ChatDialog,
'llama-3.2-3b-instruct': Llama32ChatDialog,
'mistral-7b-instruct-v0.1': MistralChatDialog,
'mistral-7b-instruct-v0.2': MistralChatDialog,
'mixtral-8x7b-instruct-v0.1': MixtralChatDialog,
Expand Down
2 changes: 2 additions & 0 deletions binding/web/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
GemmaChatDialog,
Llama2ChatDialog,
Llama3ChatDialog,
Llama32ChatDialog,
MistralChatDialog,
MixtralChatDialog,
Phi2Dialog,
Expand Down Expand Up @@ -54,6 +55,7 @@ export {
GemmaChatDialog,
Llama2ChatDialog,
Llama3ChatDialog,
Llama32ChatDialog,
MistralChatDialog,
MixtralChatDialog,
Phi2Dialog,
Expand Down
Loading
Loading