summaryrefslogtreecommitdiff
path: root/examples/llama.swiftui
diff options
context:
space:
mode:
Diffstat (limited to 'examples/llama.swiftui')
-rw-r--r--examples/llama.swiftui/llama.cpp.swift/LibLlama.swift2
-rw-r--r--examples/llama.swiftui/llama.swiftui/UI/ContentView.swift31
2 files changed, 30 insertions, 3 deletions
diff --git a/examples/llama.swiftui/llama.cpp.swift/LibLlama.swift b/examples/llama.swiftui/llama.cpp.swift/LibLlama.swift
index 272e1fd8..464fb327 100644
--- a/examples/llama.swiftui/llama.cpp.swift/LibLlama.swift
+++ b/examples/llama.swiftui/llama.cpp.swift/LibLlama.swift
@@ -203,7 +203,7 @@ actor LlamaContext {
var pp_std: Double = 0
var tg_std: Double = 0
- for r in 0..<nr {
+ for _ in 0..<nr {
// bench prompt processing
llama_batch_clear(&batch)
diff --git a/examples/llama.swiftui/llama.swiftui/UI/ContentView.swift b/examples/llama.swiftui/llama.swiftui/UI/ContentView.swift
index 219bf4dc..9cbe8efd 100644
--- a/examples/llama.swiftui/llama.swiftui/UI/ContentView.swift
+++ b/examples/llama.swiftui/llama.swiftui/UI/ContentView.swift
@@ -75,21 +75,48 @@ struct ContentView: View {
VStack {
DownloadButton(
llamaState: llamaState,
- modelName: "TinyLlama-1.1B (Q4_0)",
+ modelName: "TinyLlama-1.1B (Q4_0, 0.6 GiB)",
modelUrl: "https://huggingface.co/TheBloke/TinyLlama-1.1B-1T-OpenOrca-GGUF/resolve/main/tinyllama-1.1b-1t-openorca.Q4_0.gguf?download=true",
filename: "tinyllama-1.1b-1t-openorca.Q4_0.gguf"
)
.font(.system(size: 12))
.padding(.top, 4)
+ .frame(maxWidth: .infinity, alignment: .leading)
DownloadButton(
llamaState: llamaState,
- modelName: "TinyLlama-1.1B (Q8_0)",
+ modelName: "TinyLlama-1.1B (Q8_0, 1.1 GiB)",
modelUrl: "https://huggingface.co/TheBloke/TinyLlama-1.1B-1T-OpenOrca-GGUF/resolve/main/tinyllama-1.1b-1t-openorca.Q8_0.gguf?download=true",
filename: "tinyllama-1.1b-1t-openorca.Q8_0.gguf"
)
.font(.system(size: 12))
+ DownloadButton(
+ llamaState: llamaState,
+ modelName: "Phi-2.7B (Q4_0, 1.6 GiB)",
+ modelUrl: "https://huggingface.co/ggml-org/models/resolve/main/phi-2/ggml-model-q4_0.gguf?download=true",
+ filename: "phi-2-q4_0.gguf"
+ )
+ .font(.system(size: 12))
+ .frame(maxWidth: .infinity, alignment: .leading)
+
+ DownloadButton(
+ llamaState: llamaState,
+ modelName: "Phi-2.7B (Q8_0, 2.8 GiB)",
+ modelUrl: "https://huggingface.co/ggml-org/models/resolve/main/phi-2/ggml-model-q8_0.gguf?download=true",
+ filename: "phi-2-q8_0.gguf"
+ )
+ .font(.system(size: 12))
+
+ DownloadButton(
+ llamaState: llamaState,
+ modelName: "Mistral-7B-v0.1 (Q4_0, 3.8 GiB)",
+ modelUrl: "https://huggingface.co/TheBloke/Mistral-7B-v0.1-GGUF/resolve/main/mistral-7b-v0.1.Q4_0.gguf?download=true",
+ filename: "mistral-7b-v0.1.Q4_0.gguf"
+ )
+ .font(.system(size: 12))
+ .frame(maxWidth: .infinity, alignment: .leading)
+
Button("Clear downloaded models") {
ContentView.cleanupModelCaches()
llamaState.cacheCleared = true