GithubHelp home page GithubHelp logo

91fc / codegen Goto Github PK

View Code? Open in Web Editor NEW

This project forked from git-cloner/codegen

0.0 0.0 0.0 1.46 MB

Salesforce codegen with web server

Home Page: https://gitclone.com/aiit/chat/

License: MIT License

JavaScript 10.99% Python 75.45% CSS 1.75% HTML 11.80%

codegen's Introduction

Codegen

Salesforce codegen with web server

Fork from https://github.com/salesforce/CodeGen

Add web server support

Support GPT-J Now

Online demo

https://gitclone.com/aiit/chat/

Visual Studio Code Extension

https://github.com/git-cloner/codegeeker

usage

Clone code

git clone https://gitclone.com/github.com/git-cloner/codegen

Install

1.install Nvidia Graphics Card and Driver

2.install conda

3.init vitual runtime

conda create -n codegen python=3.8
conda activate codegen
pip install pillow -i http://pypi.douban.com/simple --trusted-host=pypi.douban.com
pip install torch torchvision torchaudio -i http://pypi.douban.com/simple --trusted-host=pypi.douban.com
pip install transformers==4.25.1 -i http://pypi.douban.com/simple --trusted-host=pypi.douban.com
pip install accelerate -i http://pypi.douban.com/simple --trusted-host=pypi.douban.com
pip install aiohttp==3.8.3 -i http://pypi.douban.com/simple --trusted-host=pypi.douban.com
pip install aiohttp_cors==0.7.0 -i http://pypi.douban.com/simple --trusted-host=pypi.douban.com
#pip install huggingface for gpt-neo
pip install datasets -i http://pypi.douban.com/simple --trusted-host=pypi.douban.com
pip install gradio -i http://pypi.douban.com/simple --trusted-host=pypi.douban.com
pip install sentencepiece==0.1.91 -i http://pypi.douban.com/simple --trusted-host=pypi.douban.com

Download model

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/

run as web server

conda activate codegen
python codegen.py

test

post: http://127.0.0.1:5000/codegen or direct post to :https://gitclone.com/aiit/codegen

Use Salesforce codegen

input params: {"context":"def hello_world():","maxlength":128}

return params: { "result": "\n print("Hello world")\n hello_world()\n ", "time": 1.9620850095525384 }

Use GPT-J

input params: {"context":"写一个python版的数组排序","maxlength":128}

codegen's People

Contributors

little51 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.