mawairon commited on
Commit
dc3cae8
·
verified ·
1 Parent(s): 9b849f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -83,6 +83,10 @@ model.eval()
83
 
84
  # Define a function to process the DNA sequence
85
  def analyze_dna(sequence):
 
 
 
 
86
  # Preprocess the input sequence
87
  inputs = tokenizer(sequence, truncation=True, padding='max_length', max_length=512, return_tensors="pt", return_token_type_ids=False)
88
 
 
83
 
84
  # Define a function to process the DNA sequence
85
  def analyze_dna(sequence):
86
+
87
+ assert all(nucleotide in 'ACTGN' for nucleotide in sequence), "Sequence contains invalid characters"
88
+ assert len(sequence) >= 300, "Sequence needs to be at least 300 nucleotides long"
89
+
90
  # Preprocess the input sequence
91
  inputs = tokenizer(sequence, truncation=True, padding='max_length', max_length=512, return_tensors="pt", return_token_type_ids=False)
92