Browse Source
Update README
Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
1 changed files with
3 additions and
2 deletions
-
README.md
|
@ -15,7 +15,8 @@ This operator is implemented with pre-trained models from [Huggingface Transform |
|
|
## Code Example |
|
|
## Code Example |
|
|
|
|
|
|
|
|
Use the pre-trained model "huggingface/CodeBERTa-small-v1" |
|
|
Use the pre-trained model "huggingface/CodeBERTa-small-v1" |
|
|
to generate text embeddings for given code "" and text description "". |
|
|
|
|
|
|
|
|
to generate text embeddings for given |
|
|
|
|
|
text description "return max value" and code "def max(a,b): if a>b: return a else return b". |
|
|
|
|
|
|
|
|
*Write the pipeline*: |
|
|
*Write the pipeline*: |
|
|
|
|
|
|
|
@ -34,7 +35,7 @@ import towhee |
|
|
import towhee |
|
|
import towhee |
|
|
|
|
|
|
|
|
( |
|
|
( |
|
|
towhee.dc['text'](['find max value', 'def max(a,b): if a>b: return a else return b']) |
|
|
|
|
|
|
|
|
towhee.dc['text'](['return max value', 'def max(a,b): if a>b: return a else return b']) |
|
|
.code_search.codebert['text', 'embedding']() |
|
|
.code_search.codebert['text', 'embedding']() |
|
|
.show() |
|
|
.show() |
|
|
) |
|
|
) |
|
|