MCPcopy Create free account
hub / github.com/Tencent/digitalhuman / cli_main

Function cli_main

HATE/basic_hate/main.py:44–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42
43
44def cli_main():
45 print(args.tasks_dir)
46 if not args.skip_saving:
47 f = open(f"{args.output_path}/results_{args.postfix}.jsonl", "w" if args.overwrite else "a")
48 agentversepipeline = TaskSolving.from_task(args.task, args.tasks_dir, args.postfix)
49 plan, result, logs, decision_making_process = agentversepipeline.run()
50 total_spent = agentversepipeline.environment.get_spend()
51 if not args.skip_saving:
52 f.write(
53 json.dumps(
54 {
55 "input": agentversepipeline.environment.task_description,
56 "response": plan,
57 "logs": logs,
58 "decision_making_process": decision_making_process,
59 "spent": total_spent
60 }, ensure_ascii=False
61 )
62 + "\n"
63 )
64 f.flush()
65 f.close()
66 return
67
68if __name__ == "__main__":
69 cli_main()

Callers 1

main.pyFile · 0.70

Calls 7

printFunction · 0.85
writeMethod · 0.80
from_taskMethod · 0.45
runMethod · 0.45
get_spendMethod · 0.45
flushMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected