Archived
A non-path owner/name is downloaded before bring-up and the model path rewritten to the cached dir, so a new user points --model at a repo link instead of a pre-fetched checkpoint. hfget.sh now keys its re-run skip on lfs.oid (sha256) for LFS files and size for the rest, recorded in a .hfget-manifest, so a same-size weight update is caught and re-fetched while a warm cache stays a no-rehash no-op.
22 lines
770 B
C++
22 lines
770 B
C++
/* main.cpp -- the entry point. Everything it does is in engine.h's comment; this file only turns
|
|
* a command line into that sequence and a status into an exit code.
|
|
*/
|
|
#include "engine.h"
|
|
|
|
int main(int argc, char** argv) {
|
|
rad::Config cfg;
|
|
int s = rad::config_parse(argc, argv, &cfg);
|
|
if (s == 1) { rad::config_usage(argv[0]); return 0; }
|
|
if (s < 0) { rad::config_usage(argv[0]); return 2; }
|
|
|
|
if (!rad::resolve_hf_model(cfg)) return 2; /* --model given as an HF repo id: fetch + rewrite */
|
|
|
|
rad::Engine engine(std::move(cfg));
|
|
|
|
s = engine.start();
|
|
if (s < 0) return 1; /* start() already said what and why */
|
|
|
|
if (engine.config().debug_graph) return engine.dump();
|
|
return engine.serve() < 0 ? 1 : 0;
|
|
}
|