File tree Expand file tree Collapse file tree 4 files changed +19
-2
lines changed
runtime/tests/tools/ggma_run Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 44
55It takes GGMA package as input. It uses ** GGMA API** internally.
66
7+ ## Options
8+
9+ - ` -p, --prompt ` : Specify the input prompt text (default: "Lily picked up a flower.")
10+
711## Usage
812
913```
1014$ ./ggma_run path_to_ggma_package
15+ $ ./ggma_run path_to_ggma_package -p "Your custom prompt here"
16+ $ ./ggma_run path_to_ggma_package --prompt "What is the weather today?"
1117```
1218
13- It will run a GGML package to generate the output using the default prompt .
19+ It will run a GGMA package to generate the output.
1420
1521## Example
1622
Original file line number Diff line number Diff line change @@ -50,6 +50,10 @@ Args::Args(const int argc, char **argv)
5050void Args::initialize (void )
5151{
5252 _arser.add_argument (" path" ).type (arser::DataType::STR).help (" nnpackage path" );
53+ _arser.add_argument (" -p" , " --prompt" )
54+ .type (arser::DataType::STR)
55+ .default_value (" Lily picked up a flower." )
56+ .help (" input prompt text" );
5357 arser::Helper::add_version (_arser, print_version);
5458}
5559
@@ -80,6 +84,11 @@ void Args::parse(const int argc, char **argv)
8084 exit (1 );
8185 }
8286 }
87+
88+ if (_arser[" --prompt" ])
89+ {
90+ _prompt = _arser.get <std::string>(" --prompt" );
91+ }
8392 }
8493 catch (const std::bad_cast &e)
8594 {
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ class Args
3333 void print (void );
3434
3535 const std::string &packagePath () const { return _package_path; }
36+ const std::string &prompt () const { return _prompt; }
3637 bool printVersion () const { return _print_version; }
3738
3839private:
@@ -43,6 +44,7 @@ class Args
4344 arser::Arser _arser;
4445
4546 std::string _package_path;
47+ std::string _prompt;
4648 bool _print_version = false ;
4749};
4850
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ int main(const int argc, char **argv)
3838 {
3939 Args args (argc, argv);
4040
41- std::string prompt = " Lily picked up a flower. " ;
41+ std::string prompt = args. prompt () ;
4242 constexpr size_t n_tokens_max = 32 ;
4343 ggma_token tokens[n_tokens_max];
4444 size_t n_tokens;
You can’t perform that action at this time.
0 commit comments