From 075b03edfc3c275d175e12928b4ea287c1539acd Mon Sep 17 00:00:00 2001 From: Jael Gu Date: Tue, 8 Nov 2022 15:52:46 +0800 Subject: [PATCH] Update README Signed-off-by: Jael Gu --- README.md | 8 ++++---- result.png | Bin 0 -> 13026 bytes 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 result.png diff --git a/README.md b/README.md index e307d2e..2cbf9b6 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,8 @@ to generate text embeddings for given code "" and text description "". import towhee ( - towhee.dc([""]) - .text_embedding.transformers(model_name="distilbert-base-cased") + towhee.dc(['find max value', 'def max(a,b): if a>b: return a else return b']) + .code_search.codebert(model_name='huggingface/CodeBERTa-small-v1') ) ``` @@ -34,8 +34,8 @@ import towhee import towhee ( - towhee.dc['text'](["Hello, world."]) - .text_embedding.transformers['text', 'vec'](model_name="distilbert-base-cased") + towhee.dc['text'](['find max value', 'def max(a,b): if a>b: return a else return b']) + .code_search.codebert['text', 'embedding'](model_name='huggingface/CodeBERTa-small-v1') .show() ) ``` diff --git a/result.png b/result.png new file mode 100644 index 0000000000000000000000000000000000000000..ea62d440ea220a081704c582fd9093a601f14ec8 GIT binary patch literal 13026 zcmZ|0WmH>D6g3>6KyfHgv`BH+Hc+HUkr3RiSdk(P?k)vNiv=gRyA%&zT#IXh6nBa{ zAAMf`@#RP6%)Mulb@tjbv+rJWzo{zA;bBu^0{{R#ko*UA0N@$qDeiv$^aa?12yp=b z{KcRTlA0bU`%{uc06G9F@6F|TB-{Gx7y3kHKpp^&;)0e%B>@b809??vG5!mX0M2G% z0>C!L7+w|?010^fA1VLk{?C+uxnp=wgOL9x4USR-S@~&CMi*uNk))3RLQq&`f-Xp+ zDj{v+3#>Z)_sK|cZE(EA68RS=J`^CG9Ig*b75E4C8EV=lr!RpEVP{{;9uK@}3ENLD zy`^X#6TQ7;9()r^k~Rz803H8ybKRw1D3N%U7+KJFQ{CO;26TvB14K)VQehxM-)oUp z-0Bbo=iH`o#PgBJ3B+f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