Skip to content

Commit

Permalink
Update the cache config template file and example directory
Browse files Browse the repository at this point in the history
Signed-off-by: SimFG <bang.fu@zilliz.com>
  • Loading branch information
SimFG committed May 23, 2023
1 parent 1825e90 commit cb3074f
Show file tree
Hide file tree
Showing 18 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cache_config_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ pre_function:
post_function:
first
config:
threshold: 0.8
similarity_threshold: 0.8
# Set other config here
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ pre_function:
post_function:
first
config:
threshold: 0.8
similarity_threshold: 0.8
# Set other config here
```
- model_src: The model source.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import time

from gptcache.processor.pre import get_input_image_file_name
from gptcache import cache

from gptcache.embedding import Timm, Onnx
from gptcache.adapter import replicate
from gptcache.similarity_evaluation.np import NumpyNormEvaluation
from gptcache.embedding import Timm, Onnx
from gptcache.manager import get_data_manager, CacheBase, VectorBase, ObjectBase
from gptcache.processor.pre import get_input_image_file_name
from gptcache.similarity_evaluation.np import NumpyNormEvaluation

timm = Timm('resnet18')
onnx = Onnx()
Expand All @@ -23,7 +22,7 @@
)


image_path = '../../docs/GPTCache.png'
image_path = '../../../docs/GPTCache.png'


# run replicate clinet with gptcache
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import os
import io
import os
import time

from PIL import Image

from gptcache import cache
from gptcache.processor.pre import get_prompt
from gptcache.adapter.stability_sdk import StabilityInference, generation
from gptcache.embedding import Onnx
from gptcache.manager.factory import manager_factory
from gptcache.processor.pre import get_prompt
from gptcache.similarity_evaluation.distance import SearchDistanceEvaluation

# init gptcache
onnx = Onnx()
data_manager = manager_factory('sqlite,faiss,local',
data_dir='./',
data_manager = manager_factory('sqlite,faiss,local',
data_dir='/',
vector_params={'dimension': onnx.dimension},
object_params={'path': './images'}
)
Expand Down
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ pexpect
spacy
safetensors
protobuf==3.20.0
typing_extensions<4.6.0

0 comments on commit cb3074f

Please sign in to comment.