Skip to content

Commit

Permalink
Enable adapter.replicate docstring in API reference (#260)
Browse files Browse the repository at this point in the history
Signed-off-by: Jael Gu <[email protected]>
  • Loading branch information
jaelgu authored Apr 20, 2023
1 parent b0d4278 commit 93319b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/_exts/docgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(self, output_dir='references', skip_list=[]):
self.skip_list = _default_skip_list + skip_list
self.expand_func_list = ['core']
self.add_list = [
'adapter.api', 'adapter.adapter', 'adapter.openai', 'adapter.diffusers', 'adapter.langchain_models'
'adapter.api', 'adapter.adapter', 'adapter.openai', 'adapter.diffusers', 'adapter.langchain_models', 'adapter.replicate'
]

@staticmethod
Expand Down
3 changes: 2 additions & 1 deletion examples/replicate_examples/vqa.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
timm = Timm('resnet18')
cache_base = CacheBase('sqlite')
vector_base = VectorBase('faiss', dimension=timm.dimension)
object_base = ObjectBase('local', path='./images')
object_base = ObjectBase('local', path='./objects')
data_manager = get_data_manager(cache_base, vector_base, object_base)

cache.init(
Expand Down Expand Up @@ -40,6 +40,7 @@
print('Answer:', output)
print('Time elapsed 1:', end - start)

start = time.time()
output = replicate.run(
"andreasjansson/blip-2:xxx",
input={
Expand Down
2 changes: 1 addition & 1 deletion gptcache/adapter/replicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Client(replicate.client.Client):
# run replicate clinet with gptcache
output = replicate.run(
"andreasjansson/blip-2:4b32258c42e9efd4288bb9910bc532a69727f9acd26aa08e175713a0a857a608",
"andreasjansson/blip-2:xxx",
input={"image": open("/path/to/merlion.png", "rb"),
"question": "Which city is this photo taken on?"}
)
Expand Down

0 comments on commit 93319b5

Please sign in to comment.