LiteCoder/LiteCoder_SourceCode
LiteCoder Experiment Reproducing package To run the pre-train objective use the following scripts: Reproduce LiteCoder with all objectives: Navigate the folder Pre-training containing the LiteCoder.py file Then, run Python LiteCoder.py --train-tt --train-cs --train-pd The pretrained model is released on hugging face, therefore it automatically loads. To run the ablation studies: Ablation 1: Python LiteCoder.py --train-tt Ablation 2: Python LiteCoder.py --train-tt… See the full description on the dataset page: https://huggingface.co/datasets/LiteCoder/LiteCoder_SourceCode.
011
LiteCoder Experiment Reproducing package
- To run the pre-train objective use the following scripts:
- Reproduce LiteCoder with all objectives:
- Navigate the folder
Pre-trainingcontaining theLiteCoder.pyfile - Then, run
Python LiteCoder.py --train-tt --train-cs --train-pd
- The pretrained model is released on hugging face, therefore it automatically loads.
- To run the ablation studies:
- Ablation 1:
Python LiteCoder.py --train-tt - Ablation 2:
Python LiteCoder.py --train-tt --train-cs - Ablation 3:
Python LiteCoder.py --train-tt --train-cs --train-pd
- To
Fine-tuningLiteCoder on downstream tasks:
- Navigate to the
Fine-tuningfolder and thenDownstream taskfolder:
- Code Clone Detection:
- Follow the instruction of
readme.mdfile.
- Code Translation:
- Run
setup.shfile. - Navigate to the
scripts/finetuneand runtranslate.shfile.
- To extract the programming language features (i.e.,
token type,code sememe, andcode dependencies) - We used open source datasets to extract language features. we released the extracted datasets on the Hugging Face:
LT_Java: LiteCoder/LT_JavaLT_Python: LiteCoder/LT_PythonLT_Java_Dependency: LiteCoder/LT_Java_Dependency
- Navigate to the utils directory:
- Use either the
JavaorPythonnotebook file to run over your dataset. - Run the cells, for which, you want to extract the features.
- Dependencies:
- Feature extraction dependencies:
- pip install ast-comments
- pip install ast
- pip install javalang
- pip install tree-sitter
- Model training dependencies:- pip install transformers
- pip install datasets
- pip install pytorch_lightning
- pip install torch
- Or
pip install -r requirements.txt
