Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -58,12 +58,12 @@ def parse_fasta(text):
|
|
58 |
|
59 |
return sequences
|
60 |
|
61 |
-
def predict(
|
62 |
-
if
|
63 |
return "Please upload a FASTA file"
|
64 |
|
65 |
-
# Read the file
|
66 |
-
text =
|
67 |
|
68 |
# Load model and scaler
|
69 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
@@ -109,5 +109,5 @@ iface = gr.Interface(
|
|
109 |
title="Virus Host Classifier"
|
110 |
)
|
111 |
|
112 |
-
# Launch
|
113 |
-
iface.launch()
|
|
|
58 |
|
59 |
return sequences
|
60 |
|
61 |
+
def predict(file_obj):
|
62 |
+
if file_obj is None:
|
63 |
return "Please upload a FASTA file"
|
64 |
|
65 |
+
# Read the file content
|
66 |
+
text = file_obj.read().decode()
|
67 |
|
68 |
# Load model and scaler
|
69 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
|
|
109 |
title="Virus Host Classifier"
|
110 |
)
|
111 |
|
112 |
+
# Launch with public link
|
113 |
+
iface.launch(share=True)
|