wenkai commited on
Commit
6ef1f27
1 Parent(s): c34048a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -35,7 +35,6 @@ models = {
35
  'Cellular Component': get_model('Cellar Component'),
36
  }
37
 
38
-
39
  # Load the mistral model
40
  mistral_model = MistralForCausalLM.from_pretrained("teknium/OpenHermes-2.5-Mistral-7B", torch_dtype=torch.float16)
41
  mistral_model.to('cuda')
@@ -183,11 +182,11 @@ def generate_caption(protein, prompt):
183
  return res_str
184
  res_str = ''
185
  if len(union_pred_terms[0]) != 0:
186
- res_str += f"Based on the given amino acid sequence, the protein appears to have a primary function of {', '.join(pred_terms)}. "
187
  if len(union_pred_terms[1]) != 0:
188
- res_str += f"It is likely involved in the {', '.join(pred_terms)}. "
189
  if len(union_pred_terms[2]) != 0:
190
- res_str += f"It's subcellular localization is within the {', '.join(pred_terms)}."
191
  return res_str
192
  # return "test"
193
 
 
35
  'Cellular Component': get_model('Cellar Component'),
36
  }
37
 
 
38
  # Load the mistral model
39
  mistral_model = MistralForCausalLM.from_pretrained("teknium/OpenHermes-2.5-Mistral-7B", torch_dtype=torch.float16)
40
  mistral_model.to('cuda')
 
182
  return res_str
183
  res_str = ''
184
  if len(union_pred_terms[0]) != 0:
185
+ res_str += f"Based on the given amino acid sequence, the protein appears to have a primary function of {', '.join(union_pred_terms[0])}. "
186
  if len(union_pred_terms[1]) != 0:
187
+ res_str += f"It is likely involved in the {', '.join(union_pred_terms[1])}. "
188
  if len(union_pred_terms[2]) != 0:
189
+ res_str += f"It's subcellular localization is within the {', '.join(union_pred_terms[2])}."
190
  return res_str
191
  # return "test"
192