tx-model-standalone / README.md
Yuto2007's picture
Upload folder using huggingface_hub
27f1bc1 verified
---
license: apache-2.0
tags:
- biology
- genomics
- single-cell
library_name: transformers
---
# TXModel - Hub-Ready Version
**Zero-hassle deployment!** Requires ONLY:
```bash
pip install transformers torch safetensors
```
## πŸš€ Quick Start
```python
from transformers import AutoModel
import torch
# Load from Hub (one command!)
model = AutoModel.from_pretrained(
"your-username/model-name",
trust_remote_code=True
)
# Use immediately
genes = torch.randint(0, 100, (2, 10))
values = torch.rand(2, 10)
masks = torch.ones(2, 10).bool()
model.eval()
with torch.no_grad():
output = model(genes=genes, values=values, gen_masks=masks)
print(output.last_hidden_state.shape) # [2, 10, d_model]
```
## ✨ Features
- βœ… **Single file** - all code in `modeling.py`
- βœ… **Zero dependencies** (except transformers + torch)
- βœ… **Works with AutoModel** out of the box
- βœ… **No import errors** - everything self-contained
## πŸ“¦ Installation
```bash
pip install transformers torch safetensors
```
That's it!
## 🎯 Usage
### Basic Inference
```python
from transformers import AutoModel
model = AutoModel.from_pretrained(
"your-username/model-name",
trust_remote_code=True
)
# Move to GPU if available
device = "cuda" if torch.cuda.is_available() else "cpu"
model = model.to(device)
```
### Batch Processing
```python
# Your data
batch = {
'genes': torch.randint(0, 1000, (32, 100)),
'values': torch.rand(32, 100),
'masks': torch.ones(32, 100).bool()
}
# Process
model.eval()
with torch.no_grad():
output = model(**batch)
```
## πŸ“Š Model Details
- **Parameters**: ~70M
- **Architecture**: Transformer Encoder
- **Hidden Size**: 512
- **Layers**: 12
- **Heads**: 8
## πŸ“ Citation
```bibtex
@article{tahoe2024,
title={Tahoe-x1},
author={...},
year={2024}
}
```