Text Generation
Transformers
Safetensors
English
Arabic
jais
English
Arabic
Decoder
Casual-lm
LLM
4-bit precision
custom_code
bitsandbytes
Instructions to use erfanvaredi/jais-7b-chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use erfanvaredi/jais-7b-chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="erfanvaredi/jais-7b-chat", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("erfanvaredi/jais-7b-chat", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use erfanvaredi/jais-7b-chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "erfanvaredi/jais-7b-chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "erfanvaredi/jais-7b-chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/erfanvaredi/jais-7b-chat
- SGLang
How to use erfanvaredi/jais-7b-chat 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 "erfanvaredi/jais-7b-chat" \ --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": "erfanvaredi/jais-7b-chat", "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 "erfanvaredi/jais-7b-chat" \ --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": "erfanvaredi/jais-7b-chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use erfanvaredi/jais-7b-chat with Docker Model Runner:
docker model run hf.co/erfanvaredi/jais-7b-chat
Jais-7b-chat (Its a double quantized version)
This model is the double quantized version of jais-13b-chat by core42. The aim is to run the model in GPU poor machines. For high quality tasks its better to use the 13b model not quantized one.
Model creator: Core42
Original model: jais-13b-chat
How To Run
Just run it as a text-generation pipeline task.
System Requirements:
It successfully has been tested on Google Colab Pro T4 instance.
How To Run:
- First install libs:
pip install -Uq huggingface_hub transformers bitsandbytes xformers accelerate
- Create the pipeline:
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline, TextStreamer, BitsAndBytesConfig
tokenizer = AutoTokenizer.from_pretrained("erfanvaredi/jais-7b-chat")
model = AutoModelForCausalLM.from_pretrained(
"erfanvaredi/jais-7b-chat",
trust_remote_code=True,
device_map='auto',
)
# Create a pipeline
pipe = pipeline(model=model, tokenizer=tokenizer, task='text-generation')
- Create prompt:
chat = [
{"role": "user", "content": 'Tell me a funny joke about Large Language Models.'},
]
prompt = pipe.tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
- Create streamer (Its optional. If u want to have generated texts as stream, do it else it does'nt matter):
streamer = TextStreamer(
tokenizer,
skip_prompt=True,
stop_token=[tokenizer.eos_token]
)
- Ask the model:
pipe(
prompt,
streamer=streamer,
max_new_tokens=256,
temperature=0,
)
:)
- Downloads last month
- 13