MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / image_to_text

Function image_to_text

bmtools/tools/hugging_tools/api.py:265–269  ·  view source on GitHub ↗
(model_id: str, image_file_name: str)

Source from the content-addressed store, hash-verified

263 return str(result)
264 @task
265 def image_to_text(model_id: str, image_file_name: str) -> str:
266 inference = InferenceApi(repo_id=model_id, token=CONFIG["huggingface"]["token"])
267 img_data = image_to_bytes(f"{DIRPATH}/{INPUT_PATH}/{image_file_name}")
268 result = inference(data=img_data)
269 return str(result)
270 # AUDIO tasks
271 @task
272 def text_to_speech(model_id: str, text: str) -> str:

Callers

nothing calls this directly

Calls 1

image_to_bytesFunction · 0.85

Tested by

no test coverage detected