Instructions to use GeoV/GeoV-9b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GeoV/GeoV-9b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="GeoV/GeoV-9b", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("GeoV/GeoV-9b", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use GeoV/GeoV-9b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GeoV/GeoV-9b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GeoV/GeoV-9b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/GeoV/GeoV-9b
- SGLang
How to use GeoV/GeoV-9b 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 "GeoV/GeoV-9b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GeoV/GeoV-9b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "GeoV/GeoV-9b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GeoV/GeoV-9b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use GeoV/GeoV-9b with Docker Model Runner:
docker model run hf.co/GeoV/GeoV-9b
tok class
Browse files- config.json +1 -0
- configuration_geov.py +6 -3
config.json
CHANGED
|
@@ -17,6 +17,7 @@
|
|
| 17 |
"num_hidden_layers": 32,
|
| 18 |
"rotary_emb_base": 10000,
|
| 19 |
"tie_word_embeddings": false,
|
|
|
|
| 20 |
"torch_dtype": "bfloat16",
|
| 21 |
"transformers_version": "4.28.0.dev0",
|
| 22 |
"use_cache": true,
|
|
|
|
| 17 |
"num_hidden_layers": 32,
|
| 18 |
"rotary_emb_base": 10000,
|
| 19 |
"tie_word_embeddings": false,
|
| 20 |
+
"tokenizer_class": "GeoVTokenizer",
|
| 21 |
"torch_dtype": "bfloat16",
|
| 22 |
"transformers_version": "4.28.0.dev0",
|
| 23 |
"use_cache": true,
|
configuration_geov.py
CHANGED
|
@@ -13,7 +13,6 @@
|
|
| 13 |
# See the License for the specific language governing permissions and
|
| 14 |
# limitations under the License.
|
| 15 |
""" GeoV model configuration"""
|
| 16 |
-
import geov.tokenization_geov
|
| 17 |
from transformers.configuration_utils import PretrainedConfig
|
| 18 |
from transformers.utils import logging
|
| 19 |
|
|
@@ -74,7 +73,6 @@ class GeoVConfig(PretrainedConfig):
|
|
| 74 |
>>> configuration = model.config # doctest: +SKIP
|
| 75 |
```"""
|
| 76 |
model_type = "geov"
|
| 77 |
-
tokenizer_class = geov.tokenization_geov.GeoVTokenizer
|
| 78 |
|
| 79 |
def __init__(
|
| 80 |
self,
|
|
@@ -91,10 +89,15 @@ class GeoVConfig(PretrainedConfig):
|
|
| 91 |
bos_token_id=0,
|
| 92 |
eos_token_id=2,
|
| 93 |
tie_word_embeddings=False,
|
|
|
|
| 94 |
**kwargs,
|
| 95 |
):
|
| 96 |
super().__init__(
|
| 97 |
-
bos_token_id=bos_token_id,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
)
|
| 99 |
self.vocab_size = vocab_size
|
| 100 |
self.max_position_embeddings = max_position_embeddings
|
|
|
|
| 13 |
# See the License for the specific language governing permissions and
|
| 14 |
# limitations under the License.
|
| 15 |
""" GeoV model configuration"""
|
|
|
|
| 16 |
from transformers.configuration_utils import PretrainedConfig
|
| 17 |
from transformers.utils import logging
|
| 18 |
|
|
|
|
| 73 |
>>> configuration = model.config # doctest: +SKIP
|
| 74 |
```"""
|
| 75 |
model_type = "geov"
|
|
|
|
| 76 |
|
| 77 |
def __init__(
|
| 78 |
self,
|
|
|
|
| 89 |
bos_token_id=0,
|
| 90 |
eos_token_id=2,
|
| 91 |
tie_word_embeddings=False,
|
| 92 |
+
tokenizer_class="GeoVTokenizer",
|
| 93 |
**kwargs,
|
| 94 |
):
|
| 95 |
super().__init__(
|
| 96 |
+
bos_token_id=bos_token_id,
|
| 97 |
+
eos_token_id=eos_token_id,
|
| 98 |
+
tie_word_embeddings=tie_word_embeddings,
|
| 99 |
+
tokenizer_class=tokenizer_class,
|
| 100 |
+
**kwargs
|
| 101 |
)
|
| 102 |
self.vocab_size = vocab_size
|
| 103 |
self.max_position_embeddings = max_position_embeddings
|