Spaces:
Running on Zero
Running on Zero
Commit History
22 days ago
-
Pin MHCflurry to CPU so ZeroGPU does not reject it
The reported failure was not the TIS stage, which ran fine on GPU and returned the expected 4 sites. It was MHCflurry: class1_processing_neural_network.py:1565 network.to(device) torch._C._cuda_init() RuntimeError: Low-level CUDA init reached. ZeroGPU's PyTorch CUDA emulation mode did not intercept a CUDA operation in your code. MHCflurry 2.3 is a PyTorch model whose device defaults to "auto", so on a GPU box it moves its network to CUDA during prediction. That call happens in the Gradio worker thread, outside any @spaces.GPU function, and ZeroGPU refuses it. The GPU allocation belongs to TIS Transformer. MHCflurry scores tens of thousands of peptides in seconds on CPU, so configure_pytorch(backend="cpu") costs nothing and removes the conflict. Only `backend` is set; the sibling option gpu_device_nums=[] would set CUDA_VISIBLE_DEVICES process-wide and break the TIS stage that currently works. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>ad07374 -
Chain TIS prediction to epitope prediction end to end
Extends the Space from a single-model wrapper into the full pipeline the collaboration proposal describes: sequence -> TIS Transformer -> ORF typing -> MHCflurry -> candidate peptides All three stages are existing, openly-licensed tools. MHCflurry (Apache-2.0) is used rather than NetMHCpan, whose academic licence forbids redistribution and so cannot be hosted. Verified against the installed package rather than the docs, which were wrong in ways that mattered: - The FASTA-path CSV schema differs from the documented h5/GTF one. The score column is `output`, not `tis_transformer_score` -- so the previous tidy() matched no column and the cutoff slider and sorting silently did nothing. - TIS_pos is 1-based; everything here is 0-based. The conversion lives in one named function because an off-by-one shifts every reading frame and still yields a plausible protein. - Weights ship inside the wheel, so there is no download to warm. - --start_codons defaults to near-cognate (.*TG$…5278136