Instructions to use alchemab/fabcon-medium with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use alchemab/fabcon-medium with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="alchemab/fabcon-medium")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("alchemab/fabcon-medium") model = AutoModelForCausalLM.from_pretrained("alchemab/fabcon-medium") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use alchemab/fabcon-medium with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "alchemab/fabcon-medium" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "alchemab/fabcon-medium", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/alchemab/fabcon-medium
- SGLang
How to use alchemab/fabcon-medium 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 "alchemab/fabcon-medium" \ --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": "alchemab/fabcon-medium", "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 "alchemab/fabcon-medium" \ --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": "alchemab/fabcon-medium", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use alchemab/fabcon-medium with Docker Model Runner:
docker model run hf.co/alchemab/fabcon-medium
extra_gated_heading: You need to share contact information with Alchemab to access this model
extra_gated_prompt: >-
### FAbCon Terms of Use
FAbCon models follow a [modified Apache 2.0
license](https://huggingface.co/alchemab/fabcon-large/blob/main/LICENSE.md)
extra_gated_fields:
First Name: text
Last Name: text
Email: text
Organization: text
By clicking 'Submit' below, I accept the terms of the license, agree to share contact information with Alchemab: checkbox
I agree to being contacted about future products, services, and/or partnership opportunities: checkbox
extra_gated_description: >-
The information you provide will be collected, stored, processed, and shared
in accordance with the [Alchemab Privacy
Notice](https://www.alchemab.com/privacy-policy/).
extra_gated_button_content: Submit
license: other
widget:
- text: ḢQVQLE
tags:
- biology
FAbCon-medium 🦅🧬
FAbCon is a generative, antibody-specific language model based on the Falcon model. It is pre-trained using causal language modelling, and is suitable for a range of tasks. FAbCon-small, FAbCon-medium, and FAbCon-large are available for non-commercial use via a modified Apache 2.0 license. For any users seeking commercial use of our models (and license for generated antibodies from all FAbCon models), please contact us.
| Model variant | Parameters | Config | License |
|---|---|---|---|
| FAbCon-small | 144M | 24L, 12H, 768d | Modified Apache 2.0 |
| FAbCon-medium | 297M | 28L, 16H, 1024d | Modified Apache 2.0 |
| FAbCon-large | 2.4B | 56L, 32H, 2048d | Modified Apache 2.0 |
Usage example - generation
Generating sequences can be done using HuggingFace's built-in model.generate method,
from transformers import (
PreTrainedTokenizerFast,
FalconForCausalLM
)
>>> tokenizer = PreTrainedTokenizerFast.from_pretrained("alchemab/fabcon-medium")
>>> model = FalconForCausalLM.from_pretrained("alchemab/fabcon-medium")
>>> o = model.generate(
tokenizer("Ḣ", return_tensors='pt')['input_ids'][:, :-1],
max_new_tokens=...,
top_k = ...,
temperature = ...
)
>>> decoded_seq = tokenizer.batch_decode(o)
Usage example - sequence property prediction
Use the transformers built-in SequenceClassification classes
from transformers import (
PreTrainedTokenizerFast,
FalconForSequenceClassification
)
>>> tokenizer = PreTrainedTokenizerFast.from_pretrained("alchemab/fabcon-medium")
>>> model = FalconForSequenceClassification.from_pretrained("alchemab/fabcon-medium")
>>> o = model(input_ids=tokenizer("Ḣ", return_tensors='pt')['input_ids'],
attention_mask=tokenizer("Ḣ", return_tensors='pt')['attention_mask'])