Instructions to use manycore-research/SpatialLM-Llama-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use manycore-research/SpatialLM-Llama-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="manycore-research/SpatialLM-Llama-1B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("manycore-research/SpatialLM-Llama-1B", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use manycore-research/SpatialLM-Llama-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "manycore-research/SpatialLM-Llama-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "manycore-research/SpatialLM-Llama-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/manycore-research/SpatialLM-Llama-1B
- SGLang
How to use manycore-research/SpatialLM-Llama-1B 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 "manycore-research/SpatialLM-Llama-1B" \ --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": "manycore-research/SpatialLM-Llama-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "manycore-research/SpatialLM-Llama-1B" \ --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": "manycore-research/SpatialLM-Llama-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use manycore-research/SpatialLM-Llama-1B with Docker Model Runner:
docker model run hf.co/manycore-research/SpatialLM-Llama-1B
KeyError: 'spatiallm_llama' when loading manycore-research/SpatialLM-Llama-1B with transformers
Hi Hugging Face team,
I'm trying to load the model manycore-research/SpatialLM-Llama-1B using the latest development version of transformers installed from GitHub (4.51.0.dev0), but I'm encountering the following error:
I have already updated transformers
import transformers
print(transformers.__version__)
4.51.0.dev0
# Use a pipeline as a high-level helper
from transformers import pipeline
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe = pipeline("text-generation", model="manycore-research/SpatialLM-Llama-1B")
pipe(messages)
/usr/local/lib/python3.11/dist-packages/huggingface_hub/utils/_auth.py:94: UserWarning:
The secret `HF_TOKEN` does not exist in your Colab secrets.
To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co/settings/tokens), set it as secret in your Google Colab and restart your session.
You will be able to reuse this secret in all of your notebooks.
Please note that authentication is recommended but still optional to access public models or datasets.
warnings.warn(
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
/usr/local/lib/python3.11/dist-packages/transformers/models/auto/configuration_auto.py in from_pretrained(cls, pretrained_model_name_or_path, **kwargs)
1123 try:
-> 1124 config_class = CONFIG_MAPPING[config_dict["model_type"]]
1125 except KeyError:
3 frames
KeyError: 'spatiallm_llama'
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
/usr/local/lib/python3.11/dist-packages/transformers/models/auto/configuration_auto.py in from_pretrained(cls, pretrained_model_name_or_path, **kwargs)
1124 config_class = CONFIG_MAPPING[config_dict["model_type"]]
1125 except KeyError:
-> 1126 raise ValueError(
1127 f"The checkpoint you are trying to load has model type `{config_dict['model_type']}` "
1128 "but Transformers does not recognize this architecture. This could be because of an "
ValueError: The checkpoint you are trying to load has model type `spatiallm_llama` but Transformers does not recognize this architecture. This could be because of an issue with the checkpoint, or because your version of Transformers is out of date.
You can update Transformers with the command `pip install --upgrade transformers`. If this does not work, and the checkpoint is very new, then there may not be a release version that supports this model yet. In this case, you can get the most up-to-date code by installing Transformers from source with the command `pip install git+https://github.com/huggingface/transformers.git`
However, it seems that spatiallm_llama is not yet registered in CONFIG_MAPPING, and there's no implementation of this model type in the repository as of now.
Could you please confirm:
Whether this model architecture will be officially supported in transformers
Or if it requires using a custom implementation from Manycore Research (and if so, where it might be available)
Thanks in advance for your help!
any luck?