Skip to content

Commit

Permalink
Update the version to 0.1.27 (#389)
Browse files Browse the repository at this point in the history
Signed-off-by: SimFG <bang.fu@zilliz.com>
  • Loading branch information
SimFG authored May 25, 2023
1 parent 70dd16a commit d0e27c9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
15 changes: 15 additions & 0 deletions docs/release_note.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ To read the following content, you need to understand the basic use of GPTCache,
- [Readme doc](https://github.com/zilliztech/GPTCache)
- [Usage doc](https://github.com/zilliztech/GPTCache/blob/main/docs/usage.md)

## v0.1.27 (2023.5.25)
1. Support the uform embedding, which can be used the **bilingual** (english + chinese) language

```python
from gptcache.embedding import UForm

test_sentence = 'Hello, world.'
encoder = UForm(model='unum-cloud/uform-vl-english')
embed = encoder.to_embeddings(test_sentence)

test_sentence = '什么是Github'
encoder = UForm(model='unum-cloud/uform-vl-multilingual')
embed = encoder.to_embeddings(test_sentence)
```

## v0.1.26 (2023.5.23)

1. Support the paddlenlp embedding
Expand Down
6 changes: 6 additions & 0 deletions gptcache/embedding/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"LangChain",
"Rwkv",
"PaddleNLP",
"UForm",
]


Expand All @@ -28,6 +29,7 @@
langchain = LazyImport("langchain", globals(), "gptcache.embedding.langchain")
rwkv = LazyImport("rwkv", globals(), "gptcache.embedding.rwkv")
paddlenlp = LazyImport("paddlenlp", globals(), "gptcache.embedding.paddlenlp")
uform = LazyImport("uform", globals(), "gptcache.embedding.uform")


def Cohere(model="large", api_key=None):
Expand Down Expand Up @@ -76,3 +78,7 @@ def Rwkv(model="sgugger/rwkv-430M-pile"):

def PaddleNLP(model="ernie-3.0-medium-zh"):
return paddlenlp.PaddleNLP(model)


def UForm(model="unum-cloud/uform-vl-multilingual", embedding_type="text"):
return uform.UForm(model, embedding_type)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def parse_requirements(file_name: str) -> List[str]:
setuptools.setup(
name="gptcache",
packages=find_packages(),
version="0.1.26",
version="0.1.27",
author="SimFG",
author_email="bang.fu@zilliz.com",
description="GPTCache, a powerful caching library that can be used to speed up and lower the cost of chat "
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/embedding/test_uform.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import requests

from gptcache.embedding.uform import UForm
from gptcache.embedding import UForm
from gptcache.utils import import_uform, import_pillow
from gptcache.utils.error import ParamError

Expand Down

0 comments on commit d0e27c9

Please sign in to comment.