mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 09:04:36 +00:00
arranged files, updated kobold lite, modified makefile for extra link args on linux, started RWKV implementation
This commit is contained in:
parent
9581171a9f
commit
763ad172c0
21 changed files with 13597 additions and 46 deletions
42
expose.cpp
42
expose.cpp
|
@ -53,16 +53,23 @@ extern "C"
|
|||
ModelLoadResult lr = gpttype_load_model(inputs, file_format);
|
||||
if (lr == ModelLoadResult::RETRY_LOAD)
|
||||
{
|
||||
file_format = FileFormat::GPTJ_2;
|
||||
printf("\n---\nRetrying as GPT-J model: (ver %d)\nAttempting to Load...\n---\n", file_format);
|
||||
lr = gpttype_load_model(inputs, file_format);
|
||||
}
|
||||
if (lr == ModelLoadResult::RETRY_LOAD)
|
||||
{
|
||||
file_format = FileFormat::GPTJ_3;
|
||||
printf("\n---\nRetrying as GPT-J model: (ver %d)\nAttempting to Load...\n---\n", file_format);
|
||||
lr = gpttype_load_model(inputs, file_format);
|
||||
}
|
||||
if(file_format==FileFormat::GPTJ_1)
|
||||
{
|
||||
//if we tried 1 first, then try 3 and lastly 2
|
||||
//otherwise if we tried 3 first, then try 2
|
||||
file_format = FileFormat::GPTJ_3;
|
||||
printf("\n---\nRetrying as GPT-J model: (ver %d)\nAttempting to Load...\n---\n", file_format);
|
||||
lr = gpttype_load_model(inputs, file_format);
|
||||
}
|
||||
|
||||
//lastly try format 2
|
||||
if (lr == ModelLoadResult::RETRY_LOAD)
|
||||
{
|
||||
file_format = FileFormat::GPTJ_2;
|
||||
printf("\n---\nRetrying as GPT-J model: (ver %d)\nAttempting to Load...\n---\n", file_format);
|
||||
lr = gpttype_load_model(inputs, file_format);
|
||||
}
|
||||
}
|
||||
|
||||
if (lr == ModelLoadResult::FAIL || lr == ModelLoadResult::RETRY_LOAD)
|
||||
{
|
||||
|
@ -92,6 +99,19 @@ extern "C"
|
|||
return true;
|
||||
}
|
||||
}
|
||||
else if(file_format==FileFormat::RWKV_1)
|
||||
{
|
||||
printf("\n---\nIdentified as RWKV model: (ver %d)\nAttempting to Load...\n---\n", file_format);
|
||||
ModelLoadResult lr = gpttype_load_model(inputs, file_format);
|
||||
if (lr == ModelLoadResult::FAIL || lr == ModelLoadResult::RETRY_LOAD)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\n---\nIdentified as LLAMA model: (ver %d)\nAttempting to Load...\n---\n", file_format);
|
||||
|
@ -102,7 +122,7 @@ extern "C"
|
|||
generation_outputs generate(const generation_inputs inputs, generation_outputs &output)
|
||||
{
|
||||
if (file_format == FileFormat::GPTJ_1 || file_format == FileFormat::GPTJ_2 || file_format==FileFormat::GPTJ_3
|
||||
|| file_format==FileFormat::GPT2_1 || file_format==FileFormat::GPT2_2 )
|
||||
|| file_format==FileFormat::GPT2_1 || file_format==FileFormat::GPT2_2 || file_format==FileFormat::RWKV_1)
|
||||
{
|
||||
return gpttype_generate(inputs, output);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue