Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
|