Instructions to use ichitaka/falcon-40b-instruct-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ichitaka/falcon-40b-instruct-8bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ichitaka/falcon-40b-instruct-8bit", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ichitaka/falcon-40b-instruct-8bit", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ichitaka/falcon-40b-instruct-8bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ichitaka/falcon-40b-instruct-8bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ichitaka/falcon-40b-instruct-8bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ichitaka/falcon-40b-instruct-8bit
- SGLang
How to use ichitaka/falcon-40b-instruct-8bit 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 "ichitaka/falcon-40b-instruct-8bit" \ --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": "ichitaka/falcon-40b-instruct-8bit", "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 "ichitaka/falcon-40b-instruct-8bit" \ --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": "ichitaka/falcon-40b-instruct-8bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ichitaka/falcon-40b-instruct-8bit with Docker Model Runner:
docker model run hf.co/ichitaka/falcon-40b-instruct-8bit
Could not locate the configuration_RW.py inside tiiuae/falcon-40b-instruct.
I am trying to use this version after I used the falcon-40b-instruct
this is the code:
model_config = AutoConfig.from_pretrained('ichitaka/falcon-40b-instruct-8bit', trust_remote_code=True)
model_config.max_seq_len = self.model_max_length
model = AutoModelForCausalLM.from_pretrained(
ichitaka/falcon-40b-instruct-8bit,
trust_remote_code=True,
config=model_config,
quantization_config=self.bnb_config,
torch_dtype=torch.bfloat16,
device_map='auto'
)
model.eval() # Set the model to evaluation mode
tokenizer = AutoTokenizer.from_pretrained(
'ichitaka/falcon-40b-instruct-8bit', padding_side="left", truncation_side="left",
model_max_length=self.model_max_length
)
# Most LLMs don't have a pad token by default
tokenizer.pad_token = tokenizer.eos_token
And the fist line returned -> tiiuae/falcon-40b-instruct does not appear to have a file named configuration_RW.py. Checkout 'https://huggingface.co/tiiuae/falcon-40b-instruct/main' for available files.
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings
I also checked this thread -> https://huggingface.co/tiiuae/falcon-7b/discussions/60 but it didn't work
Thanks for your help