Skip to content

Commit

Permalink
[iOS] Update mistral v2 support (#1439)
Browse files Browse the repository at this point in the history
* [iOS] Update mistral v2 support

Also drops the support for add new models as it is fragile atm.
Add extended virtual memory option so we can go beyond 4G for q4.

* prep for release
  • Loading branch information
tqchen authored Dec 15, 2023
1 parent 9d6ae50 commit 51fb0f4
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 36 deletions.
4 changes: 2 additions & 2 deletions ios/MLCChat.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
"$(inherited)",
"$(PROJECT_DIR)/build/lib",
);
MARKETING_VERSION = 1.1;
MARKETING_VERSION = 1.2;
OTHER_LDFLAGS = (
"-Wl,-all_load",
"-lmodel_iphone",
Expand Down Expand Up @@ -482,7 +482,7 @@
"$(inherited)",
"$(PROJECT_DIR)/build/lib",
);
MARKETING_VERSION = 1.1;
MARKETING_VERSION = 1.2;
OTHER_LDFLAGS = (
"-Wl,-all_load",
"-lmodel_iphone",
Expand Down
2 changes: 2 additions & 0 deletions ios/MLCChat/MLCChat.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.kernel.extended-virtual-addressing</key>
<true/>
<key>com.apple.developer.kernel.increased-memory-limit</key>
<true/>
</dict>
Expand Down
4 changes: 1 addition & 3 deletions ios/MLCChat/States/AppState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ final class AppState: ObservableObject {
guard let appConfig else {
return
}

loadPrebuiltModels()
loadModelsConfig(modelList: appConfig.modelList)
loadExampleModelsConfig(exampleModels: appConfig.exampleModels)

loadPrebuiltModels()
}

func requestAddModel(url: String, localID: String?) {
Expand Down
12 changes: 0 additions & 12 deletions ios/MLCChat/Views/StartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@ struct StartView: View {
}
.buttonStyle(.borderless)
}
if !isAdding {
Button("Add model variant") {
isAdding = true
}
.buttonStyle(.borderless)
} else {
Button("Cancel add model variant") {
isAdding = false
inputModelUrl = ""
}
.buttonStyle(.borderless)
}
}
if isAdding {
Section(header: Text("Click below to import sample model variants, these variants may contain same weights as builtin ones")) {
Expand Down
18 changes: 1 addition & 17 deletions ios/MLCChat/app-config.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
{
"model_libs": [
"Mistral-7B-Instruct-v0.1-q3f16_1",
"Mistral-7B-Instruct-v0.2-q3f16_1",
"Llama-2-7b-chat-hf-q3f16_1",
"RedPajama-INCITE-Chat-3B-v1-q4f16_1"
],
"model_list": [
{
"model_url": "https://huggingface.co/mlc-ai/mlc-chat-OpenHermes-2.5-Mistral-7B-q3f16_1/",
"local_id": "OpenHermes-2.5-Mistral-7B-q3f16_1"
},
{
"model_url": "https://huggingface.co/mlc-ai/mlc-chat-Mistral-7B-Instruct-v0.1-q3f16_1/",
"local_id": "Mistral-7B-Instruct-v0.1-q3f16_1"
},
{
"model_url": "https://huggingface.co/mlc-ai/mlc-chat-Llama-2-7b-chat-hf-q3f16_1/",
"local_id": "Llama-2-7b-chat-hf-q3f16_1"
Expand All @@ -23,14 +15,6 @@
}
],
"add_model_samples": [
{
"model_url": "https://huggingface.co/mlc-ai/mlc-chat-OpenHermes-2.5-Mistral-7B-q3f16_1/",
"local_id": "OpenHermes-2.5-Mistral-7B-q3f16_1"
},
{
"model_url": "https://huggingface.co/mlc-ai/mlc-chat-Mistral-7B-Instruct-v0.1-q3f16_1/",
"local_id": "Mistral-7B-Instruct-v0.1-q3f16_1"
},
{
"model_url": "https://huggingface.co/mlc-ai/mlc-chat-Llama-2-7b-chat-hf-q3f16_1/",
"local_id": "Llama-2-7b-chat-hf-q3f16_1"
Expand Down
4 changes: 2 additions & 2 deletions ios/prepare_params.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ rm -rf dist
mkdir -p dist

declare -a builtin_list=(
"OpenHermes-2.5-Mistral-7B-q3f16_1"
# "Mistral-7B-Instruct-v0.1-q3f16_1"
"Mistral-7B-Instruct-v0.2-q3f16_1"
#"OpenHermes-2.5-Mistral-7B-q3f16_1"
# "Llama-2-7b-chat-hf-q3f16_1"
# "RedPajama-INCITE-Chat-3B-v1-q4f16_1"
# "vicuna-v1-7b-q3f16_0"
Expand Down

0 comments on commit 51fb0f4

Please sign in to comment.