Download src/scenarios/interrogation.py from Akcom/test: direct link, hf CLI and curl.
- Browser
- Download file 564 Bytes
-
https://huggingface.co/spaces/Akcom/test/resolve/main/src/scenarios/interrogation.py
- Command line
-
hf download hf://spaces/Akcom/test/src/scenarios/interrogation.py
-
curl -L -o interrogation.py https://huggingface.co/spaces/Akcom/test/resolve/main/src/scenarios/interrogation.py
564 Bytes
| import os | |
| import spaces | |
| from src.modules.models.model_loader import model_loader as ModelLoader | |
| from src.storage.state import state as State | |
| def image_describe(image_path): | |
| State.begin() | |
| result = ModelLoader.image_describe(image_path) | |
| State.end() | |
| return result | |
| def image_test(image_path, questions): | |
| State.begin() | |
| result = [] | |
| for question in questions: | |
| out = ModelLoader.image_ask(image_path, question) | |
| result.append(out == 'Yes') | |
| State.end() | |
| return result | |