Instructions to use inceptionai/jais-13b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use inceptionai/jais-13b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="inceptionai/jais-13b", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("inceptionai/jais-13b", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use inceptionai/jais-13b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "inceptionai/jais-13b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inceptionai/jais-13b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/inceptionai/jais-13b
- SGLang
How to use inceptionai/jais-13b 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 "inceptionai/jais-13b" \ --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": "inceptionai/jais-13b", "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 "inceptionai/jais-13b" \ --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": "inceptionai/jais-13b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use inceptionai/jais-13b with Docker Model Runner:
docker model run hf.co/inceptionai/jais-13b
The current model class (JAISModel) is not compatible with `.generate()`, as it doesn't have a language model head.
Hello Team,
I encountered an error when executing the sample code and would appreciate your assistance in resolving it.
The error trace is as follows:
- The error originates in the file "", line 1, within a module.
- It traces back to a function called
get_response_testin the same file, line 5. - The issue seems to stem from the
/LLM/miniconda3/envs/jais-13b/lib/python3.10/site-packages/torch/utils/_contextlib.pyfile, specifically line 115, in thedecorate_contextfunction. - Further, in the
generatefunction of/LLM/miniconda3/envs/jais-13b/lib/python3.10/site-packages/transformers/generation/utils.pyat line 1210, there's a validation process for the model class. - The actual error is identified in line 1089 of the same file, in the
_validate_model_classfunction. It throws aTypeError, indicating that the current model class (JAISModel) is incompatible with the.generate()function, as it lacks a language model head.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 5, in get_response_test
File "/LLM/miniconda3/envs/jais-13b/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/LLM/miniconda3/envs/jais-13b/lib/python3.10/site-packages/transformers/generation/utils.py", line 1210, in generate
self._validate_model_class()
File "/LLM/miniconda3/envs/jais-13b/lib/python3.10/site-packages/transformers/generation/utils.py", line 1089, in _validate_model_class
raise TypeError(exception_message)TypeError: The current model class (JAISModel) is not compatible with .generate(), as it doesn't have a language model head.>>>
Looking forward to your guidance to fix this issue.
Thanks,
I am also facing the same issue, any fix for this?
@FK7 I was able to work with it by using AutoModelForCausalLM, the JAIS team are using it for language head with JAISLMHeadModel mapped to AutoModelForCausalLM, hope it works
I have the same issue when I tried to quantize the model.