Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix readme encoding #659

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Slash Your LLM API Costs by 10x 💰, Boost Speed by 100x ⚡

📔 This project is undergoing swift development, and as such, the API may be subject to change at any time. For the most up-to-date information, please refer to the latest [documentation]( https://gptcache.readthedocs.io/en/latest/) and [release note](https://github.com/zilliztech/GPTCache/blob/main/docs/release_note.md).

**NOTE:** As the number of large models is growing explosively and their API shape is constantly evolving, we no longer add support for new API or models. We encourage the usage of using the get and set API in gptcache, here is the demo code: https://github.com/zilliztech/GPTCache/blob/main/examples/adapter/api.py

## Quick Install

`pip install gptcache`
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ refer to the implementation of [milvus](https://github.com/zilliztech/GPTCache/b

## Add a new data manager

refer to the implementation of [MapDataManager, SSDataManager](https://github.com/zilliztech/GPTCache/blob/main/gptcache/cache/data_manager.py).
refer to the implementation of [MapDataManager, SSDataManager](https://github.com/zilliztech/GPTCache/blob/main/gptcache/manager/data_manager.py).

1. Implement the [DataManager](https://github.com/zilliztech/GPTCache/blob/main/gptcache/manager/data_manager.py) interface
2. Add the new store to the [get_data_manager](https://github.com/zilliztech/GPTCache/blob/main/gptcache/manager/data_manager.py) method
Expand Down
2 changes: 1 addition & 1 deletion gptcache/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""gptcache version"""
__version__ = "0.1.43"
__version__ = "0.1.44"

from gptcache.config import Config
from gptcache.core import Cache
Expand Down
8 changes: 7 additions & 1 deletion gptcache/manager/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ def manager_factory(manager="map",
maxmemory_samples=eviction_params.get("maxmemory_samples", scalar_params.get("maxmemory_samples")),
)

if eviction_manager == "memory":
return get_data_manager(s, v, o, None,
eviction_params.get("max_size", 1000),
eviction_params.get("clean_size", None),
eviction_params.get("eviction", "LRU"),)

e = EvictionBase(
name=eviction_manager,
**eviction_params
Expand Down Expand Up @@ -194,7 +200,7 @@ def get_data_manager(
vector_base = VectorBase(name=vector_base)
if isinstance(object_base, str):
object_base = ObjectBase(name=object_base)
if isinstance(eviction_base, str):
if isinstance(eviction_base, str) and eviction_base != "memory":
eviction_base = EvictionBase(name=eviction_base)
assert cache_base and vector_base
return SSDataManager(cache_base, vector_base, object_base, eviction_base, max_size, clean_size, eviction)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
here = os.path.abspath(os.path.dirname(__file__))


with open("README.md", "r") as fh:
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()


Expand Down
Loading