Image-Text-to-Text
Transformers
Safetensors
English
sa2va_chat
feature-extraction
vision-language
vlm
grpo
earthmind
geospatial
remote-sensing
conversational
custom_code
Instructions to use aadex/Earthmind-R1-test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aadex/Earthmind-R1-test with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="aadex/Earthmind-R1-test", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("aadex/Earthmind-R1-test", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aadex/Earthmind-R1-test with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aadex/Earthmind-R1-test" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aadex/Earthmind-R1-test", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/aadex/Earthmind-R1-test
- SGLang
How to use aadex/Earthmind-R1-test with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "aadex/Earthmind-R1-test" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aadex/Earthmind-R1-test", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "aadex/Earthmind-R1-test" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aadex/Earthmind-R1-test", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use aadex/Earthmind-R1-test with Docker Model Runner:
docker model run hf.co/aadex/Earthmind-R1-test
Upload EarthMind-4B GRPO fine-tuned model
Browse files
model-00001-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4993044040
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:95c37865bba2047023551374f7f52de2865c291a5aab8bae66ff4a4da06bf8ef
|
| 3 |
size 4993044040
|
model-00002-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 2890805372
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:63a362812e67807d16402e375cc8e8a9c6a72a6af22582af52a8de3ad6d6ed79
|
| 3 |
size 2890805372
|
modeling_earthmind_chat.py
CHANGED
|
@@ -37,14 +37,9 @@ from torchvision.transforms.functional import resize, to_pil_image
|
|
| 37 |
from types import MethodType
|
| 38 |
import torch.nn.functional as F
|
| 39 |
|
| 40 |
-
|
| 41 |
-
# flash_attention import removed for inference without flash_attn
|
| 42 |
-
# from .flash_attention import FlashAttention
|
| 43 |
FlashAttention = None
|
| 44 |
-
|
| 45 |
-
except:
|
| 46 |
-
print('FlashAttention is not installed.')
|
| 47 |
-
has_flash_attn = False
|
| 48 |
|
| 49 |
logger = logging.get_logger(__name__)
|
| 50 |
|
|
|
|
| 37 |
from types import MethodType
|
| 38 |
import torch.nn.functional as F
|
| 39 |
|
| 40 |
+
# flash_attention removed - not needed for inference
|
|
|
|
|
|
|
| 41 |
FlashAttention = None
|
| 42 |
+
has_flash_attn = False
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
logger = logging.get_logger(__name__)
|
| 45 |
|
modeling_intern_vit.py
CHANGED
|
@@ -20,14 +20,9 @@ from transformers.utils import logging
|
|
| 20 |
|
| 21 |
from .configuration_intern_vit import InternVisionConfig
|
| 22 |
|
| 23 |
-
|
| 24 |
-
# flash_attention import removed for inference without flash_attn
|
| 25 |
-
# from .flash_attention import FlashAttention
|
| 26 |
FlashAttention = None
|
| 27 |
-
|
| 28 |
-
except:
|
| 29 |
-
print('FlashAttention is not installed.')
|
| 30 |
-
has_flash_attn = False
|
| 31 |
|
| 32 |
logger = logging.get_logger(__name__)
|
| 33 |
|
|
|
|
| 20 |
|
| 21 |
from .configuration_intern_vit import InternVisionConfig
|
| 22 |
|
| 23 |
+
# flash_attention removed - not needed for inference
|
|
|
|
|
|
|
| 24 |
FlashAttention = None
|
| 25 |
+
has_flash_attn = False
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
logger = logging.get_logger(__name__)
|
| 28 |
|