oucgc1996 commited on
Commit
f4c361f
·
verified ·
1 Parent(s): 002ef29

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -51,9 +51,13 @@ def Kmers_funct(seq,num):
51
  def ACE(file):
52
  test_seq = file
53
  all = []
54
- for j in range(2, 11):
55
- X = Kmers_funct([test_seq], j)
56
- all.extend(X)
 
 
 
 
57
  model = MyModel()
58
  model.load_state_dict(torch.load("best_model.pth", map_location=torch.device('cpu')), strict=False)
59
  model = model.to(device)
 
51
  def ACE(file):
52
  test_seq = file
53
  all = []
54
+ seq_len = len(test_seq)
55
+ if seq_len <= 30:
56
+ for j in range(2, 11):
57
+ X = Kmers_funct([test_seq], j)
58
+ all.extend(X)
59
+ else:
60
+ all.append(test_seq)
61
  model = MyModel()
62
  model.load_state_dict(torch.load("best_model.pth", map_location=torch.device('cpu')), strict=False)
63
  model = model.to(device)