Download Adam/MLLM_API.py from OpenCausaLab/ADAM: direct link, hf CLI and curl.
- Browser
- Download file 414 Bytes
-
https://huggingface.co/OpenCausaLab/ADAM/resolve/main/Adam/MLLM_API.py
- Command line
-
hf download hf://OpenCausaLab/ADAM/Adam/MLLM_API.py
-
curl -L -o MLLM_API.py https://huggingface.co/OpenCausaLab/ADAM/resolve/main/Adam/MLLM_API.py
414 Bytes
| import requests | |
| def get_image_description(image_path='Adam/game_image/tmp.png', local_mllm_port=7000): | |
| text = 'Please describe this Minecraft image' | |
| url = 'http://localhost:' + str(local_mllm_port) + '/send_image_text' | |
| files = {'image': open(image_path, 'rb')} | |
| data = {'text': text} | |
| response = requests.post(url, data=data, files=files) | |
| files['image'].close() | |
| return response.text | |