From 7fb1b03d39ff89c953c6e8dd50d4e33a820720bc Mon Sep 17 00:00:00 2001 From: Jael Gu Date: Tue, 8 Nov 2022 16:24:27 +0800 Subject: [PATCH] Add graphcodebert Signed-off-by: Jael Gu --- README.md | 9 +++++++-- codebert.py | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6d634d7..1b6cdd7 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,8 @@ A code search operator takes a text string of programming language or natural language as an input and returns an embedding vector in ndarray which captures the input's core semantic elements. -This operator is implemented with pre-trained models from [Huggingface Transformers](https://huggingface.co/docs/transformers). +This operator is implemented with pre-trained [CodeBert](https://arxiv.org/pdf/2002.08155.pdf) +or [GraphCodeBert](https://arxiv.org/abs/2009.08366) models from [Huggingface Transformers](https://huggingface.co/docs/transformers).
@@ -64,7 +65,11 @@ The device to run model inference. The default value is None, which enables GPU if cuda is available. Supported model names: - +- huggingface/CodeBERTa-small-v1 +- microsoft/codebert-base +- microsoft/codebert-base-mlm +- mrm8488/codebert-base-finetuned-stackoverflow-ner +- microsoft/graphcodebert-base
diff --git a/codebert.py b/codebert.py index de3ed5b..a80ce6c 100644 --- a/codebert.py +++ b/codebert.py @@ -143,7 +143,8 @@ class CodeBert(NNOperator): 'huggingface/CodeBERTa-small-v1', 'microsoft/codebert-base', 'microsoft/codebert-base-mlm', - 'mrm8488/codebert-base-finetuned-stackoverflow-ner' + 'mrm8488/codebert-base-finetuned-stackoverflow-ner', + 'microsoft/graphcodebert-base' ] full_list.sort() if format is None: