Download annotations/annotation_37/AlphaRec/main.py from mcy98/RECODE-H: direct link, hf CLI and curl.
- Browser
- Download file 969 Bytes
-
https://huggingface.co/datasets/mcy98/RECODE-H/resolve/main/annotations/annotation_37/AlphaRec/main.py
- Command line
-
hf download hf://datasets/mcy98/RECODE-H/annotations/annotation_37/AlphaRec/main.py
-
curl -L -o main.py https://huggingface.co/datasets/mcy98/RECODE-H/resolve/main/annotations/annotation_37/AlphaRec/main.py
969 Bytes
| from parse import parse_args | |
| from utils import fix_seeds | |
| import os | |
| import torch | |
| if __name__ == '__main__': | |
| args, special_args = parse_args() | |
| print(args) | |
| fix_seeds(args.seed) # set random seed | |
| rs_type = args.rs_type # LLM, Seq, General, etc. | |
| print(f'from models.{rs_type}.'+ args.model_name + ' import ' + args.model_name + '_RS') | |
| # from models.General.UniSRec import UniSRec_RS | |
| try: | |
| exec(f'from models.{args.rs_type}.'+ args.model_name + ' import ' + args.model_name + '_RS') # load the model | |
| except: | |
| print('Model %s not implemented!' % (args.model_name)) | |
| # RS = UniSRec_RS(args, special_args) | |
| # from models.General.IntentCF import IntentCF_RS | |
| # RS = IntentCF_RS(args, special_args) | |
| try: | |
| RS = eval(args.model_name + '_RS(args, special_args)') # load the recommender system | |
| except: | |
| RS = eval(args.model_name + '_RS(args)') | |
| RS.execute() # train and test | |
| print('Done!') | |