Open MalteT opened 11 months ago
Right. It's the problem of upstream ClapSerde
. However, the changes proposed above may cause another problem - the value of "model" in config file (if exists) will always be overridden by "gpt-3.5-turbo"
.
To work around the problem, the only solution I can think of is to write lots of boilerplate code to manually parse arguments, such as
let opts_from_file = { ...read opts... }
...
clap::Arg::new("model")
.long("model")
.default_value(opts_from_file.model)
That means we can't use the macro to derive clap
args anymore.
Even worse, we need to maintain 2 copies of arguments: one as the code above, and one as a struct
for serde
. It's a bit too heavy just for argument parsing...
When omitting
--model
from the command line (I have no config file), I get the following error:despite these https://github.com/fuyufjh/heygpt/blob/3be31cb78971380de02f8f370658be931f1c645c/src/main.rs#L33-L35
I've never worked with ClapSerde, and it looks like an issue on their part, but the following dublication fixes it for me.
Thanks for your work!