Instructions to use thesven/falcon-11B-GPTQ-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thesven/falcon-11B-GPTQ-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="thesven/falcon-11B-GPTQ-4bit", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("thesven/falcon-11B-GPTQ-4bit", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("thesven/falcon-11B-GPTQ-4bit", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use thesven/falcon-11B-GPTQ-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "thesven/falcon-11B-GPTQ-4bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thesven/falcon-11B-GPTQ-4bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/thesven/falcon-11B-GPTQ-4bit
- SGLang
How to use thesven/falcon-11B-GPTQ-4bit 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 "thesven/falcon-11B-GPTQ-4bit" \ --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": "thesven/falcon-11B-GPTQ-4bit", "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 "thesven/falcon-11B-GPTQ-4bit" \ --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": "thesven/falcon-11B-GPTQ-4bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use thesven/falcon-11B-GPTQ-4bit with Docker Model Runner:
docker model run hf.co/thesven/falcon-11B-GPTQ-4bit
Model Card for Model ID
Model Details
Model Description
This model is a quantized version of Falcon2-11B by tiiuae. Quantization was performed with Auto-GPTQ to 4bit.
- Developed by: TIIIUAE
- Quantised by: Michael Svendsen
Getting Started
from transformers import AutoTokenizer, AutoModelForCausalLM, GPTQConfig
pretrained_model_name = "thesven/falcon-11B-GPTQ-4bit"
device = "cuda:0"
# Load the tokenizer
tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name)
# Load the model with the specified configuration and move to device
model = AutoModelForCausalLM.from_pretrained(
pretrained_model_name,
device_map="auto",
)
# Set EOS token ID
model.eos_token_id = tokenizer.eos_token_id
# Move model to the specified device
model.to(device)
# Define the input text
input_text = "Why is the sky blue?"
# Encode the input text
input_ids = tokenizer.encode(input_text, return_tensors="pt").to(device)
# Generate output
output = model.generate(input_ids, max_length=1000)
# Decode the generated output
decoded_output = tokenizer.batch_decode(output, skip_special_tokens=True)
# Print the decoded output
for i, sequence in enumerate(decoded_output):
print(f"Generated Sequence {i+1}: {sequence}")
License
Falcon2-11B is licenced under [TII Falcon License 2.0(https://falconllm-staging.tii.ae/falcon-2-terms-and-conditions.html), the permissive Apache 2.0-based software license which includes an acceptable use policy that promotes the responsible use of AI.
Uses
Direct Use
Research on large language models; as a foundation for further specialization and finetuning for specific usecases (e.g., summarization, text generation, chatbot, etc.)
Out-of-Scope Use
Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful.
Bias, Risks, and Limitations
Falcon2-11B is trained mostly on English, but also German, Spanish, French, Italian, Portuguese, Polish, Dutch, Romanian, Czech, Swedish. It will not generalize appropriately to other languages. Furthermore, as it is trained on a large-scale corpora representative of the web, it will carry the stereotypes and biases commonly encountered online.
Recommendations
We recommend users of Falcon2-11B to consider finetuning it for the specific set of tasks of interest, and for guardrails and appropriate precautions to be taken for any production use.
- Downloads last month
- 5