Instructions to use aduncan94/EnhancAR-Sorted with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aduncan94/EnhancAR-Sorted with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aduncan94/EnhancAR-Sorted")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("aduncan94/EnhancAR-Sorted") model = AutoModelForCausalLM.from_pretrained("aduncan94/EnhancAR-Sorted") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use aduncan94/EnhancAR-Sorted with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aduncan94/EnhancAR-Sorted" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aduncan94/EnhancAR-Sorted", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/aduncan94/EnhancAR-Sorted
- SGLang
How to use aduncan94/EnhancAR-Sorted 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 "aduncan94/EnhancAR-Sorted" \ --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": "aduncan94/EnhancAR-Sorted", "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 "aduncan94/EnhancAR-Sorted" \ --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": "aduncan94/EnhancAR-Sorted", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use aduncan94/EnhancAR-Sorted with Docker Model Runner:
docker model run hf.co/aduncan94/EnhancAR-Sorted
Update README.md
Browse files
README.md
CHANGED
|
@@ -30,12 +30,36 @@ EnhancAR-sorted is a generative enhancer model that can be used for:
|
|
| 30 |
## Getting Started with EnhancAR-Sorted
|
| 31 |
|
| 32 |
**Requirements**:
|
| 33 |
-
* PyTorch:
|
| 34 |
-
* CUDA:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
**Example generation**:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
```py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
|
|
|
| 39 |
```
|
| 40 |
|
| 41 |
## Technical Specifications
|
|
@@ -46,4 +70,3 @@ EnhancAR-sorted is a generative enhancer model that can be used for:
|
|
| 46 |
## Citation
|
| 47 |
|
| 48 |
If you use the code, models, or results, please cite our [preprint]()
|
| 49 |
-
*
|
|
|
|
| 30 |
## Getting Started with EnhancAR-Sorted
|
| 31 |
|
| 32 |
**Requirements**:
|
| 33 |
+
* PyTorch: 2.7.1
|
| 34 |
+
* CUDA: 12.8 and above
|
| 35 |
+
|
| 36 |
+
```py
|
| 37 |
+
pip install transformers==4.48.2 huggingface_hub
|
| 38 |
+
```
|
| 39 |
|
| 40 |
**Example generation**:
|
| 41 |
+
|
| 42 |
+
The following shows an example for generating an unconditional sequence. To generate a sequence conditionally, replace the input_sequence with a string of the form:
|
| 43 |
+
{homolog A/homolog B/.../homolog N}.
|
| 44 |
+
|
| 45 |
+
For a full example, please see the [Google Colab]()
|
| 46 |
+
|
| 47 |
```py
|
| 48 |
+
import torch
|
| 49 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoConfig
|
| 50 |
+
|
| 51 |
+
config = AutoConfig.from_pretrained("aduncan94/EnhancAR-Sorted", trust_remote_code=True)
|
| 52 |
+
config.use_mamba_kernels = False
|
| 53 |
+
model = AutoModelForCausalLM.from_pretrained("aduncan94/EnhancAR-Sorted", trust_remote_code=True, config=config).to("cuda")
|
| 54 |
+
tokenizer = AutoTokenizer.from_pretrained("aduncan94/EnhancAR-Sorted", trust_remote_code=True)
|
| 55 |
+
|
| 56 |
+
input_sequence = "{"
|
| 57 |
+
inputs = tokenizer(input_sequence, return_tensors="pt", return_token_type_ids=False, add_special_tokens=False)
|
| 58 |
+
|
| 59 |
+
outputs = generate_sequence(inputs, model, tokenizer)
|
| 60 |
+
output = tokenizer.batch_decode(outputs, skip_special_tokens=False)[0]
|
| 61 |
|
| 62 |
+
print(output)
|
| 63 |
```
|
| 64 |
|
| 65 |
## Technical Specifications
|
|
|
|
| 70 |
## Citation
|
| 71 |
|
| 72 |
If you use the code, models, or results, please cite our [preprint]()
|
|
|