Skip to content

kiminh/RecFound

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generative Representational Learning of Foundation Models for Recommendation

This is the github repository for paper Generative Representational Learning of Foundation Models for Recommendation.

Requirements

  1. Install dependencies
pip install -r requirements.txt
  1. Install GradCache
cd training/GradCache
pip install -e .
cd ../..
  1. Environment Setup

This project requires modifications to specific packages for training and inference environments.

For Training Environment:

  • Replace transformers/models/llama/modeling_llama.py with env/Training Environment/transformers/modeling_llama.py
  • Replace peft/tuners/lora/model.py with env/Training Environment/peft/model.py
  • Apply similar replacements for other files in the Training Environment folder

For Inference Environment:

  • Replace files similarly using the env/Inference Environment/ versions

Start

Here is a simplified command to run the program. For more detailed parameter settings, please refer to the corresponding configuration file.

Training

python scripts/run_script.py \
    --base_model_path /path/to/base/model \
    --train_data_path /path/to/train/data \
    --output_dir /path/to/output

Evaluation

For Generative Tasks:

python scripts/run_inference_eval_gen.py \
    --base_model_path /path/to/base/model \
    --peft_path /path/to/trained/adapter \
    --test_data_path /path/to/test/data

For Embedding Tasks:

python scripts/run_inference_eval_emb.py \
    --base_model_path /path/to/base/model \
    --peft_path /path/to/trained/adapter \
    --test_data_path /path/to/test/data

Model Merging

python merge/merge_moe.py

Dataset

The Dataset is available in https://huggingface.co/datasets/Anonqwq/RecFound.

Model

The TMoLE model checkpoint is available in https://huggingface.co/Anonqwq/RecFound-7B. You can load the module on Mistral-7B-v0.3-Instruct after getting ready for the environment.

Acknowledgments

Built upon:

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%