TianlaiChen commited on
Commit
eefdf2d
·
1 Parent(s): 9fb1a0f
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -3,10 +3,12 @@ from transformers import AutoTokenizer, AutoModelForMaskedLM
3
  import torch
4
  from torch.distributions.categorical import Categorical
5
 
 
6
  # Load the model and tokenizer
7
  tokenizer = AutoTokenizer.from_pretrained("TianlaiChen/PepMLM-650M")
8
  model = AutoModelForMaskedLM.from_pretrained("TianlaiChen/PepMLM-650M")
9
 
 
10
  def generate_peptide(protein_seq, peptide_length, top_k):
11
  print('Within')
12
  peptide_length = int(peptide_length)
@@ -29,6 +31,11 @@ def generate_peptide(protein_seq, peptide_length, top_k):
29
 
30
  generated_peptide = tokenizer.decode(predicted_token_ids, skip_special_tokens=True)
31
  return f"Generated Sequence: {generated_peptide.replace(' ', '')}"
 
 
 
 
 
32
 
33
  # Define the Gradio interface
34
  interface = gr.Interface(
 
3
  import torch
4
  from torch.distributions.categorical import Categorical
5
 
6
+ '''
7
  # Load the model and tokenizer
8
  tokenizer = AutoTokenizer.from_pretrained("TianlaiChen/PepMLM-650M")
9
  model = AutoModelForMaskedLM.from_pretrained("TianlaiChen/PepMLM-650M")
10
 
11
+
12
  def generate_peptide(protein_seq, peptide_length, top_k):
13
  print('Within')
14
  peptide_length = int(peptide_length)
 
31
 
32
  generated_peptide = tokenizer.decode(predicted_token_ids, skip_special_tokens=True)
33
  return f"Generated Sequence: {generated_peptide.replace(' ', '')}"
34
+ '''
35
+
36
+ def hello():
37
+ print('hello')
38
+ return "hello"
39
 
40
  # Define the Gradio interface
41
  interface = gr.Interface(