Download tcod/trinity/cli/server.py from SeanWang0027/ftb-sciworld-repro: direct link, hf CLI and curl.
- Browser
- Download file 643 Bytes
-
https://huggingface.co/SeanWang0027/ftb-sciworld-repro/resolve/main/tcod/trinity/cli/server.py
- Command line
-
hf download hf://SeanWang0027/ftb-sciworld-repro/tcod/trinity/cli/server.py
-
curl -L -o server.py https://huggingface.co/SeanWang0027/ftb-sciworld-repro/resolve/main/tcod/trinity/cli/server.py
643 Bytes
| import traceback | |
| import fire | |
| from flask import Flask, jsonify, request | |
| app = Flask(__name__) | |
| APP_NAME = "trinity_rft" | |
| def trinity_training(): | |
| config_path = request.args.get("configPath") | |
| try: | |
| from trinity.cli.launcher import run | |
| run(config_path) | |
| ret = 0 | |
| msg = "Training Success." | |
| except: # noqa: E722 | |
| traceback.print_exc() | |
| msg = traceback.format_exc() | |
| ret = 1 | |
| return jsonify({"return_code": ret, "message": msg}) | |
| def main(port=5006): | |
| app.run(port=port, debug=True) | |
| if __name__ == "__main__": | |
| fire.Fire(main) | |