hiyata commited on
Commit
63d967d
·
verified ·
1 Parent(s): 870813f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -58,12 +58,12 @@ def parse_fasta(text):
58
 
59
  return sequences
60
 
61
- def predict(file):
62
- if not file:
63
  return "Please upload a FASTA file"
64
 
65
- # Read the file
66
- text = file.decode('utf-8')
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)