Skip to content

Commit

Permalink
Dev: add Qwen2.5 and Llama3.2 models
Browse files Browse the repository at this point in the history
  • Loading branch information
andriydruk committed Oct 1, 2024
1 parent 1078ee5 commit ee48f84
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 24 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ LM Playground is designed as a universal platform for experimenting with various
![preview](art/Preview.png)

## Currently supported models
* Qwen2 0.5B
* Qwen2.5 0.5B
* Qwen2.5 1.5B
* Llama3.2 1B
* Llama3.2 3B
* Google Gemma2 2B
* Microsoft Phi 3.1B
* Meta Llama 3 7B
* Microsoft Phi3.5 mini
* Llama3.1 7B
* Mistral 7B
* Google Gemma2 2B
* Google Gemma2 9B

## Install
If you're just looking to install LM Playground, you can find it on [Google Play](https://play.google.com/store/apps/details?id=com.druk.lmplayground). If you're a developer wanting to contribute, read on.
Expand Down
1 change: 1 addition & 0 deletions app/src/main/cpp/LlamaCpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class LlamaModel {
std::string input_prefix,
std::string input_suffix,
std::vector<std::string> antiprompt,
int32_t n_ctx,
int32_t n_gpu_layers,
llama_progress_callback progress_callback,
void* progress_callback_user_data);
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/cpp/LlamaModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ void LlamaModel::loadModel(const gpt_params& params_arg,
std::string input_prefix,
std::string input_suffix,
std::vector<std::string> antiprompt,
int32_t n_ctx,
int32_t n_gpu_layers,
llama_progress_callback progress_callback,
void * progress_callback_user_data) {
params = params_arg;
params.interactive = true;
params.n_ctx = 2048;
params.interactive_first = true;
params.input_prefix = std::move(input_prefix);
params.input_suffix = std::move(input_suffix);
Expand Down
1 change: 1 addition & 0 deletions app/src/main/cpp/native-lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Java_com_druk_llamacpp_LlamaCpp_loadModel(JNIEnv *env,
std::string(inputPrefixCStr),
std::string(inputSuffixCStr),
antiprompt_vector,
2048,
-1,
[](float progress, void *ctx) -> bool {
auto* context = static_cast<CallbackContext*>(ctx);
Expand Down
67 changes: 47 additions & 20 deletions app/src/main/java/com/druk/lmplayground/models/ModelInfoProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,41 @@ object ModelInfoProvider {
val files = path.listFiles()
return listOf(
ModelInfo(
name = "Qwen2 0.5B",
file = files?.firstOrNull { it.name == "qwen2-0_5b-instruct-q4_k_m.gguf" },
remoteUri = Uri.parse("https://huggingface.co/Qwen/Qwen2-0.5B-Instruct-GGUF/resolve/main/qwen2-0_5b-instruct-q4_k_m.gguf"),
name = "Qwen2.5 0.5B",
file = files?.firstOrNull { it.name == "Qwen2.5-0.5B-Instruct-Q4_K_M.gguf" },
remoteUri = Uri.parse("https://huggingface.co/lmstudio-community/Qwen2.5-0.5B-Instruct-GGUF/resolve/main/Qwen2.5-0.5B-Instruct-Q4_K_M.gguf?download=true"),
inputPrefix = "<|im_start|>user\n",
inputSuffix = "<|im_end|>\n<|im_start|>assistant\n",
antiPrompt = arrayOf("<|im_end|>"),
description = "0.5 billion parameters language model"
),
ModelInfo(
name = "Qwen2.5 1.5B",
file = files?.firstOrNull { it.name == "Qwen2.5-1.5B-Instruct-Q4_K_M.gguf" },
remoteUri = Uri.parse("https://huggingface.co/lmstudio-community/Qwen2.5-1.5B-Instruct-GGUF/resolve/main/Qwen2.5-1.5B-Instruct-Q4_K_M.gguf?download=true"),
inputPrefix = "<|im_start|>user\n",
inputSuffix = "<|im_end|>\n<|im_start|>assistant\n",
antiPrompt = arrayOf("<|im_end|>"),
description = "1.5 billion parameters language model"
),
ModelInfo(
name = "Llama3.2 1B",
file = files?.firstOrNull { it.name == "Llama-3.2-1B-Instruct-Q4_K_M.gguf" },
remoteUri = Uri.parse("https://huggingface.co/lmstudio-community/Llama-3.2-1B-Instruct-GGUF/resolve/main/Llama-3.2-1B-Instruct-Q4_K_M.gguf?download=true"),
inputPrefix = "<|start_header_id|>user<|end_header_id|>\n\n",
inputSuffix = "<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n",
antiPrompt = arrayOf("<|eot_id|>"),
description = "1 billions parameters language model"
),
ModelInfo(
name = "Llama3.2 3B",
file = files?.firstOrNull { it.name == "Llama-3.2-3B-Instruct-Q4_K_M.gguf" },
remoteUri = Uri.parse("https://huggingface.co/lmstudio-community/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf?download=true"),
inputPrefix = "<|start_header_id|>user<|end_header_id|>\n\n",
inputSuffix = "<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n",
antiPrompt = arrayOf("<|eot_id|>"),
description = "3 billions parameters language model"
),
ModelInfo(
name = "Gemma2 2B",
file = files?.firstOrNull { it.name == "gemma-2b-it-q4_k_m.gguf" },
Expand All @@ -28,39 +55,39 @@ object ModelInfoProvider {
description = "2 billions parameters language model"
),
ModelInfo(
name = "Phi 3.1",
file = files?.firstOrNull { it.name == "Phi-3.1-mini-4k-instruct-Q4_K_M.gguf" },
remoteUri = Uri.parse("https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/resolve/main/Phi-3.1-mini-4k-instruct-Q4_K_M.gguf"),
name = "Phi3.5 mini",
file = files?.firstOrNull { it.name == "Phi-3.5-mini-instruct-Q4_K_M.gguf" },
remoteUri = Uri.parse("https://huggingface.co/bartowski/Phi-3.5-mini-instruct-GGUF/resolve/main/Phi-3.5-mini-instruct-Q4_K_M.gguf?download=true"),
inputPrefix = "<|user|>\n",
inputSuffix = "<|end|>\n<|assistant|>\n",
antiPrompt = arrayOf("<|end|>", "<|assistant|>"),
description = "3.8 billions parameters language model"
),
ModelInfo(
name = "Gemma2 9B",
file = files?.firstOrNull { it.name == "gemma-2-9b-it-Q4_K_M.gguf" },
remoteUri = Uri.parse("https://huggingface.co/bartowski/gemma-2-9b-it-GGUF/resolve/main/gemma-2-9b-it-Q4_K_M.gguf"),
inputPrefix = "<start_of_turn>user\n",
inputSuffix = "<end_of_turn>\n<start_of_turn>model\n",
antiPrompt = arrayOf("<start_of_turn>user", "<start_of_turn>model", "<end_of_turn>"),
description = "8.5 billions parameters language model"
),
ModelInfo(
name = "Mistral 7B",
file = files?.firstOrNull { it.name == "mistral-7b-instruct-v0.2.Q4_K_M.gguf" },
remoteUri = Uri.parse("https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.2-GGUF/resolve/main/mistral-7b-instruct-v0.2.Q4_K_M.gguf"),
file = files?.firstOrNull { it.name == "Mistral-7B-Instruct-v0.3-Q4_K_M.gguf" },
remoteUri = Uri.parse("https://huggingface.co/lmstudio-community/Mistral-7B-Instruct-v0.3-GGUF/resolve/main/Mistral-7B-Instruct-v0.3-Q4_K_M.gguf?download=true"),
inputPrefix = "[INST]",
inputSuffix = "[/INST]",
description = "7.3 billions parameter language model"
),
ModelInfo(
name = "Llama 3 8B",
file = files?.firstOrNull { it.name == "Meta-Llama-3-8B-Instruct-Q4_K_M.gguf" },
remoteUri = Uri.parse("https://huggingface.co/lmstudio-community/Meta-Llama-3-8B-Instruct-GGUF/resolve/main/Meta-Llama-3-8B-Instruct-Q4_K_M.gguf"),
name = "Llama3.1 8B",
file = files?.firstOrNull { it.name == "Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf" },
remoteUri = Uri.parse("https://huggingface.co/lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF/resolve/main/Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf?download=true"),
inputPrefix = "<|start_header_id|>user<|end_header_id|>\n\n",
inputSuffix = "<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n",
antiPrompt = arrayOf("<|eot_id|>"),
description = "8 billions parameters language model"
),
ModelInfo(
name = "Gemma2 9B",
file = files?.firstOrNull { it.name == "gemma-2-9b-it-Q4_K_M.gguf" },
remoteUri = Uri.parse("https://huggingface.co/bartowski/gemma-2-9b-it-GGUF/resolve/main/gemma-2-9b-it-Q4_K_M.gguf"),
inputPrefix = "<start_of_turn>user\n",
inputSuffix = "<end_of_turn>\n<start_of_turn>model\n",
antiPrompt = arrayOf("<start_of_turn>user", "<start_of_turn>model", "<end_of_turn>"),
description = "8.5 billions parameters language model"
)
)
}
Expand Down

0 comments on commit ee48f84

Please sign in to comment.