-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
limit deps of cmd line aici; fixes #32
- Loading branch information
Showing
8 changed files
with
71 additions
and
63 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
Submodule llama.cpp
added at
381ee1
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 |
---|---|---|
@@ -1,6 +1,54 @@ | ||
from pyaici.comms import AiciRunner, add_cli_args | ||
import argparse | ||
|
||
__all__ = [ | ||
"AiciRunner", | ||
"add_cli_args", | ||
] | ||
def runner_from_cli(args): | ||
from pyaici.comms import AiciRunner | ||
|
||
aici = AiciRunner( | ||
rtpath=args.aici_rt, | ||
tokenizer=args.aici_tokenizer, | ||
trace_file=args.aici_trace, | ||
rtargs=args.aici_rtarg, | ||
) | ||
return aici | ||
|
||
|
||
def add_cli_args(parser: argparse.ArgumentParser, single=False): | ||
parser.add_argument( | ||
"--aici-rt", | ||
type=str, | ||
required=True, | ||
help="path to aicirt", | ||
) | ||
parser.add_argument( | ||
"--aici-tokenizer", | ||
type=str, | ||
default="llama", | ||
help="tokenizer to use; llama, gpt4, ...", | ||
) | ||
parser.add_argument( | ||
"--aici-trace", | ||
type=str, | ||
help="save trace of aicirt interaction to a JSONL file", | ||
) | ||
parser.add_argument( | ||
"--aici-rtarg", | ||
"-A", | ||
type=str, | ||
default=[], | ||
action="append", | ||
help="pass argument to aicirt process", | ||
) | ||
|
||
if single: | ||
parser.add_argument( | ||
"--aici-module", | ||
type=str, | ||
required=True, | ||
help="id of the module to run", | ||
) | ||
parser.add_argument( | ||
"--aici-module-arg", | ||
type=str, | ||
default="", | ||
help="arg passed to module (filename)", | ||
) |
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