-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit also includes: - tested 5 differents models requiring different syntax - switches to edit the syntax - improved new CLI - model loader - test CLI and basic language execution in the same script - reworked github testing
- Loading branch information
1 parent
1501ef7
commit 6216bed
Showing
18 changed files
with
292 additions
and
911 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
from ..sta.syntax import Syntax, syntax_kwargs as SyntaxKwargs | ||
from ..lm import RLM | ||
from ..lm import Llama | ||
|
||
def loader(models_path=None, syntax=None, n_ctx=4096, **syntax_kwargs): | ||
if models_path is None: | ||
lm = RLM() | ||
syntax = Syntax(**syntax_kwargs) | ||
else: | ||
lm = Llama(model_path=models_path, n_ctx=n_ctx) | ||
|
||
if syntax is None: | ||
# TODO does llama.cpp (or GUFF) contains that info? | ||
model_name = models_path.split('/')[-1] | ||
if model_name.find('llama-2') >= 0 and model_name.find('chat') >= 0: | ||
syntax = 'Llama-2-Chat' | ||
elif model_name.find('capybarahermes') >= 0: | ||
syntax = 'ChatML' | ||
elif model_name.find('tinyllama') >= 0 and model_name.find('chat') >= 0: | ||
syntax = 'ChatML' | ||
elif model_name.find('tinyllama') >= 0 and model_name.find('miniguanaco') >= 0: | ||
syntax = 'Guanaco' | ||
else: | ||
assert syntax in SyntaxKwargs | ||
|
||
if syntax is None: | ||
syntax = syntax_kwargs | ||
else: | ||
syntax = SyntaxKwargs[syntax] | ||
syntax.update(syntax_kwargs) | ||
|
||
syntax = Syntax(**syntax) | ||
|
||
return (lm,syntax) |
Oops, something went wrong.