Spaces:
Runtime error
Runtime error
wnagleiofficial
commited on
Commit
·
9d54723
1
Parent(s):
b4a5044
fix bugs
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import torch
|
| 2 |
-
from NeuroPredPLM.predict import predict, batch_predict
|
| 3 |
import gradio as gr
|
| 4 |
from io import StringIO
|
| 5 |
from Bio import SeqIO
|
|
@@ -20,7 +20,7 @@ def batch_classifier(file, cutoff):
|
|
| 20 |
for record in SeqIO.parse(file.name, 'fasta'):
|
| 21 |
data.append((record.id, str(record.seq)))
|
| 22 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 23 |
-
neuropeptide_pred =
|
| 24 |
return neuropeptide_pred
|
| 25 |
|
| 26 |
with gr.Blocks() as demo:
|
|
|
|
| 1 |
import torch
|
| 2 |
+
from NeuroPredPLM.predict import predict, batch_predict
|
| 3 |
import gradio as gr
|
| 4 |
from io import StringIO
|
| 5 |
from Bio import SeqIO
|
|
|
|
| 20 |
for record in SeqIO.parse(file.name, 'fasta'):
|
| 21 |
data.append((record.id, str(record.seq)))
|
| 22 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 23 |
+
neuropeptide_pred = batch_predict(data, cutoff, '/mnt/d/protein-net/NeuroPred-PLM/NeuroPred-PLM/model.pth', device)
|
| 24 |
return neuropeptide_pred
|
| 25 |
|
| 26 |
with gr.Blocks() as demo:
|