(model_id: str, image_file_name: str, text: str)
| 184 | return str(inference({"question": text, "image": img_base64})) |
| 185 | @task |
| 186 | def document_question_answering(model_id: str, image_file_name: str, text: str) -> str: |
| 187 | inference = InferenceApi(repo_id=model_id, token=CONFIG["huggingface"]["token"]) |
| 188 | img_data = image_to_bytes(f"{DIRPATH}/{INPUT_PATH}/{image_file_name}") |
| 189 | img_base64 = base64.b64encode(img_data).decode("utf-8") |
| 190 | return str(inference({"question": text, "image": img_base64})) |
| 191 | @task |
| 192 | def image_to_image(model_id: str, image_file_name: str) -> str: |
| 193 | img_data = image_to_bytes(f"{DIRPATH}/{INPUT_PATH}/{image_file_name}") |
nothing calls this directly
no test coverage detected