Skip to content

Commit

Permalink
update name to code assist.
Browse files Browse the repository at this point in the history
  • Loading branch information
shibing624 committed Jun 26, 2023
1 parent 7e34467 commit 09a14b9
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 36 deletions.
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[![PyPI version](https://badge.fury.io/py/autocoder.svg)](https://badge.fury.io/py/autocoder)
[![PyPI version](https://badge.fury.io/py/codeassist.svg)](https://badge.fury.io/py/codeassist)
[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](CONTRIBUTING.md)
[![GitHub contributors](https://img.shields.io/github/contributors/shibing624/autocoder.svg)](https://github.com/shibing624/autocoder/graphs/contributors)
[![GitHub contributors](https://img.shields.io/github/contributors/shibing624/codeassist.svg)](https://github.com/shibing624/codeassist/graphs/contributors)
[![License Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
[![python_vesion](https://img.shields.io/badge/Python-3.5%2B-green.svg)](requirements.txt)
[![GitHub issues](https://img.shields.io/github/issues/shibing624/autocoder.svg)](https://github.com/shibing624/autocoder/issues)
[![GitHub issues](https://img.shields.io/github/issues/shibing624/codeassist.svg)](https://github.com/shibing624/codeassist/issues)
[![Wechat Group](http://vlog.sfyc.ltd/wechat_everyday/wxgroup_logo.png?imageView2/0/w/60/h/20)](#Contact)

# AutoCoder
# CodeAssist

**AutoCoder** is an advanced code completion tool that intelligently provides high-quality code completions for Python, Java, and C++ and so on.
**CodeAssist** is an advanced code completion tool that intelligently provides high-quality code completions for Python, Java, and C++ and so on.

AutoCoder 是一个高级代码补全工具,能智能地为 Python、Java 和 C++ 等编程语言高质量补全代码
CodeAssist 是一个高级代码补全工具,能智能地为 Python、Java 和 C++ 等编程语言高质量补全代码


**Guide**
Expand Down Expand Up @@ -39,14 +39,14 @@ HuggingFace Demo: https://huggingface.co/spaces/shibing624/code-autocomplete

```
pip install torch # conda install pytorch
pip install -U autocoder
pip install -U codeassist
```

or

```
git clone https://github.com/shibing624/autocoder.git
cd AutoCoder
git clone https://github.com/shibing624/codeassist.git
cd CodeAssist
python setup.py install
```

Expand All @@ -61,12 +61,12 @@ Model upload to HF's model hub:

![hf](docs/hf_model.png)

### Use with autocoder
### Use with codeassist

example: [base_demo.py](./examples/base_demo.py)

```python
from autocoder import GPT2Coder
from codeassist import GPT2Coder

m = GPT2Coder("shibing624/code-autocomplete-gpt2-base")
print(m.generate('import torch.nn as')[0])
Expand All @@ -80,7 +80,7 @@ example: [distilgpt2_demo.py](./examples/distilgpt2_demo.py)
import sys

sys.path.append('..')
from autocoder import GPT2Coder
from codeassist import GPT2Coder

m = GPT2Coder("shibing624/code-autocomplete-distilgpt2-python")
print(m.generate('import torch.nn as')[0])
Expand All @@ -106,8 +106,8 @@ from transformers import GPT2Tokenizer, GPT2LMHeadModel

os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"

tokenizer = GPT2Tokenizer.from_pretrained("shibing624/autocoder-gpt2-base")
model = GPT2LMHeadModel.from_pretrained("shibing624/autocoder-gpt2-base")
tokenizer = GPT2Tokenizer.from_pretrained("shibing624/code-autocomplete-gpt2-base")
model = GPT2LMHeadModel.from_pretrained("shibing624/code-autocomplete-gpt2-base")
prompts = [
"import numpy as np",
"import torch.nn as",
Expand Down Expand Up @@ -219,7 +219,7 @@ DatasetDict({

| Name | Source | Download | Size |
| :------- | :--------- | :---------: | :---------: |
| Python+Java+CPP source code | Awesome-pytorch-list(5.22 Million lines) | [github_source_code.zip](https://github.com/shibing624/autocoder/releases/download/0.0.4/source_code.zip) | 105M |
| Python+Java+CPP source code | Awesome-pytorch-list(5.22 Million lines) | [github_source_code.zip](https://github.com/shibing624/codeassist/releases/download/0.0.4/source_code.zip) | 105M |

download dataset and unzip it, put to `examples/`.

Expand All @@ -241,7 +241,7 @@ cd examples
python training_gpt2_mydata.py --do_train --do_predict --num_epochs 15 --model_dir outputs-fine-tuned --model_name gpt2
```

PS: fine-tuned result model is GPT2-python: [shibing624/autocoder-gpt2-base](https://huggingface.co/shibing624/autocoder-gpt2-base),
PS: fine-tuned result model is GPT2-python: [shibing624/code-autocomplete-gpt2-base](https://huggingface.co/shibing624/code-autocomplete-gpt2-base),
i spent about 24 hours with V100 to fine-tune it.

## Server
Expand All @@ -262,34 +262,34 @@ open url: http://0.0.0.0:8001/docs
# Contact

- Issue(建议)
[![GitHub issues](https://img.shields.io/github/issues/shibing624/autocoder.svg)](https://github.com/shibing624/autocoder/issues)
[![GitHub issues](https://img.shields.io/github/issues/shibing624/codeassist.svg)](https://github.com/shibing624/codeassist/issues)
- 邮件我:xuming: xuming624@qq.com
- 微信我: 加我*微信号:xuming624, 备注:个人名称-公司-NLP* 进NLP交流群。

<img src="docs/wechat.jpeg" width="200" />

# Citation

如果你在研究中使用了autocoder,请按如下格式引用:
如果你在研究中使用了codeassist,请按如下格式引用:

APA:
```latex
Xu, M. AutoCoder: Code AutoComplete with GPT2 model (Version 0.0.4) [Computer software]. https://github.com/shibing624/autocoder
Xu, M. codeassist: Code AutoComplete with GPT2 model (Version 0.0.4) [Computer software]. https://github.com/shibing624/codeassist
```

BibTeX:
```latex
@software{Xu_autocoder_Code_AutoComplete,
@software{Xu_codeassist_Code_AutoComplete,
author = {Xu, Ming},
title = {autocoder: Code AutoComplete with Code model},
url = {https://github.com/shibing624/autocoder},
title = {CodeAssist: Code AutoComplete with Generation model},
url = {https://github.com/shibing624/codeassist},
version = {0.1.0}
}
```

# License

授权协议为 [The Apache License 2.0](/LICENSE),可免费用做商业用途。请在产品说明中附加autocoder的链接和授权协议
授权协议为 [The Apache License 2.0](/LICENSE),可免费用做商业用途。请在产品说明中附加codeassist的链接和授权协议

# Contribute

Expand Down
2 changes: 1 addition & 1 deletion autocoder/__init__.py → codeassist/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

__version__ = "0.1.0"

from autocoder.gpt2_coder import GPT2Coder
from codeassist.gpt2_coder import GPT2Coder
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/distilgpt2_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys

sys.path.append('..')
from autocoder import GPT2Coder
from codeassist import GPT2Coder

m = GPT2Coder("shibing624/code-autocomplete-distilgpt2-python")
print(m.generate('def load_csv_file(file_path):')[0])
2 changes: 1 addition & 1 deletion examples/gpt2_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys

sys.path.append('..')
from autocoder.gpt2_coder import GPT2Coder
from codeassist.gpt2_coder import GPT2Coder

m = GPT2Coder("shibing624/code-autocomplete-gpt2-base")
print(m.generate('def load_csv_file(file_path):')[0])
2 changes: 1 addition & 1 deletion examples/gradio_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import gradio as gr

sys.path.append('..')
from autocoder.gpt2_coder import GPT2Coder
from codeassist.gpt2_coder import GPT2Coder

model = GPT2Coder("shibing624/code-autocomplete-gpt2-base")

Expand Down
2 changes: 1 addition & 1 deletion examples/interact.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys

sys.path.append('..')
from autocoder.gpt2_coder import GPT2Coder
from codeassist.gpt2_coder import GPT2Coder

if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Params')
Expand Down
2 changes: 1 addition & 1 deletion examples/original_gpt2_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys

sys.path.append('..')
from autocoder.gpt2_coder import GPT2Coder
from codeassist.gpt2_coder import GPT2Coder

if __name__ == '__main__':
prompts = [
Expand Down
2 changes: 1 addition & 1 deletion examples/prepare_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from sklearn.model_selection import train_test_split

sys.path.append("..")
from autocoder import create_dataset
from codeassist import create_dataset


def main():
Expand Down
2 changes: 1 addition & 1 deletion examples/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from loguru import logger

sys.path.append('..')
from autocoder.gpt2_coder import GPT2Coder
from codeassist.gpt2_coder import GPT2Coder

pwd_path = os.path.abspath(os.path.dirname(__file__))
use_cuda = torch.cuda.is_available()
Expand Down
2 changes: 1 addition & 1 deletion examples/training_gpt2_mydata.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys

sys.path.append('..')
from autocoder import GPT2Coder
from codeassist import GPT2Coder

if __name__ == '__main__':
parser = argparse.ArgumentParser()
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
readme = f.read()

setup(
name='autocoder',
name='codeassist',
version=__version__,
description='Code AutoComplete',
long_description=readme,
Expand All @@ -29,7 +29,7 @@
'Topic :: Text Processing :: Indexing',
'Topic :: Text Processing :: Linguistic',
],
keywords='autocoder,autocomplete,code-autocomplete',
keywords='CodeGenie,autocomplete,code-autocomplete',
install_requires=[
"loguru",
"transformers",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import torch

sys.path.append('..')
from autocoder.gpt2_coder import GPT2Coder
from codeassist.gpt2_coder import GPT2Coder


class IssueTestCase(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_qps.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from time import time

sys.path.append('..')
from autocoder.gpt2_coder import GPT2Coder
from codeassist.gpt2_coder import GPT2Coder

pwd_path = os.path.abspath(os.path.dirname(__file__))

Expand Down

0 comments on commit 09a14b9

Please sign in to comment.