Skip to content

Commit

Permalink
fix embed
Browse files Browse the repository at this point in the history
  • Loading branch information
EvensXia committed Oct 30, 2024
1 parent f2aa4e3 commit 062b13f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion examples/llm_vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ async def main():
invoice_path = Path(__file__).parent.joinpath("..", "tests", "data", "invoices", "invoice-2.png")
encode_image(invoice_path)
# res = await llm.aask(msg="return `True` if this image might be a invoice, or return `False`", images=[img_base64])
await llm.aask(msg="hello")
res = await llm.aask(msg="hello")
print(res)
# assert ("true" in res.lower()) or ("invoice" in res.lower())


Expand Down
4 changes: 2 additions & 2 deletions metagpt/provider/ollama_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _parse_input_msg(self, msg: dict) -> Tuple[Optional[str], Optional[str]]:
if tpe == "text":
return msg["text"], None
elif tpe == "image_url":
return None, msg["image_url"]["url"][self._image_b64_rms :]
return None, msg["image_url"]["url"][self._image_b64_rms:]
else:
raise ValueError
else:
Expand Down Expand Up @@ -317,7 +317,7 @@ def get_choice_text(self, rsp):


@register_provider(LLMType.OLLAMA_EMBED)
class OllamaEmbed(OllamaLLM):
class OllamaEmbed(OllamaEmbeddings):
@property
def _llama_api_inuse(self) -> OllamaMessageAPI:
return OllamaMessageAPI.EMBED

0 comments on commit 062b13f

Please sign in to comment.