Salesforce codegen with web server
Fork from https://github.com/salesforce/CodeGen
Add web server support
https://gitclone.com/aiit/codegen
git clone https://gitclone.com/github.com/git-cloner/codegen
conda create -n codegen python=3.8
conda activate codegen
pip3 install --upgrade pip setuptools
pip3 install -r requirements.txt
wget -P checkpoints https://storage.googleapis.com/sfr-codegen-research/checkpoints/codegen-350M-nl.tar.gz && tar -xvf checkpoints/codegen-350M-nl.tar.gz -C checkpoints/
wget -P checkpoints https://storage.googleapis.com/sfr-codegen-research/checkpoints/codegen-350M-multi.tar.gz && tar -xvf checkpoints/codegen-350M-multi.tar.gz -C checkpoints/
wget -P checkpoints https://storage.googleapis.com/sfr-codegen-research/checkpoints/codegen-350M-mono.tar.gz && tar -xvf checkpoints/codegen-350M-mono.tar.gz -C checkpoints/
conda activate codegen
python codegen.py
post: http://127.0.0.1:5000/codegen or direct post to :https://gitclone.com/aiit/codegen input params: {"context":"def hello_world():","maxlength":128}
! note: maxlength is an integral multiple of 32
return params: { "result": "\n print("Hello world")\n hello_world()\n ", "time": 1.9620850095525384 }