Text Generation
Transformers
PyTorch
loleve
genomics
dna
language-model
causal-lm
biology
sequence-modeling
variant-prediction
promoter
indel
eqtl
custom_code
Instructions to use Marks-lab/LOL-EVE with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Marks-lab/LOL-EVE with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Marks-lab/LOL-EVE", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Marks-lab/LOL-EVE", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Marks-lab/LOL-EVE with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Marks-lab/LOL-EVE" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Marks-lab/LOL-EVE", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Marks-lab/LOL-EVE
- SGLang
How to use Marks-lab/LOL-EVE 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 "Marks-lab/LOL-EVE" \ --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": "Marks-lab/LOL-EVE", "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 "Marks-lab/LOL-EVE" \ --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": "Marks-lab/LOL-EVE", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Marks-lab/LOL-EVE with Docker Model Runner:
docker model run hf.co/Marks-lab/LOL-EVE
Updated README with PyTorch Lightning checkpoint instructions and improved usage examples
Browse files
README.md
CHANGED
|
@@ -70,9 +70,8 @@ pip install torch>=2.0.0 transformers>=4.35.0 huggingface-hub>=0.17.0
|
|
| 70 |
```python
|
| 71 |
from huggingface_hub import hf_hub_download
|
| 72 |
|
| 73 |
-
# Download model files
|
| 74 |
model_path = hf_hub_download(repo_id="Marks-lab/LOL-EVE", filename="pytorch_model.bin")
|
| 75 |
-
config_path = hf_hub_download(repo_id="Marks-lab/LOL-EVE", filename="config.json")
|
| 76 |
tokenizer_path = hf_hub_download(repo_id="Marks-lab/LOL-EVE", filename="tokenizer.json")
|
| 77 |
```
|
| 78 |
|
|
@@ -82,19 +81,15 @@ Since this model uses a custom architecture, you'll need to load it using PyTorc
|
|
| 82 |
|
| 83 |
```python
|
| 84 |
import torch
|
| 85 |
-
import json
|
| 86 |
|
| 87 |
-
# Load
|
| 88 |
-
with open(config_path, 'r') as f:
|
| 89 |
-
config = json.load(f)
|
| 90 |
-
|
| 91 |
-
# Load model state dict
|
| 92 |
model_state = torch.load(model_path, map_location='cpu')
|
| 93 |
|
| 94 |
-
print(f"Model type: {config['model_type']}")
|
| 95 |
-
print(f"Layers: {config['num_layers']}")
|
| 96 |
-
print(f"Embedding dimension: {config['num_embd']}")
|
| 97 |
print(f"Model parameters: {sum(p.numel() for p in model_state.values()):,}")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
```
|
| 99 |
|
| 100 |
## Testing the Model
|
|
|
|
| 70 |
```python
|
| 71 |
from huggingface_hub import hf_hub_download
|
| 72 |
|
| 73 |
+
# Download essential model files
|
| 74 |
model_path = hf_hub_download(repo_id="Marks-lab/LOL-EVE", filename="pytorch_model.bin")
|
|
|
|
| 75 |
tokenizer_path = hf_hub_download(repo_id="Marks-lab/LOL-EVE", filename="tokenizer.json")
|
| 76 |
```
|
| 77 |
|
|
|
|
| 81 |
|
| 82 |
```python
|
| 83 |
import torch
|
|
|
|
| 84 |
|
| 85 |
+
# Load model weights
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
model_state = torch.load(model_path, map_location='cpu')
|
| 87 |
|
|
|
|
|
|
|
|
|
|
| 88 |
print(f"Model parameters: {sum(p.numel() for p in model_state.values()):,}")
|
| 89 |
+
print(f"Model size: ~2.6GB")
|
| 90 |
+
|
| 91 |
+
# To use the model, you'll need to implement the LOLEVEForCausalLM class
|
| 92 |
+
# and load these weights into your model instance
|
| 93 |
```
|
| 94 |
|
| 95 |
## Testing the Model
|