wenkai commited on
Commit
9f17684
1 Parent(s): d3260a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -15,9 +15,9 @@ model_esm, alphabet = pretrained.load_model_and_alphabet('esm2_t36_3B_UR50D')
15
  model_esm.to('cuda')
16
 
17
  # Load the model
18
- model = Blip2ProteinMistral(config=FAPMConfig(), esm_size='3b')
19
- model.load_checkpoint("model/checkpoint_mf2.pth")
20
- model.to('cuda')
21
 
22
 
23
  @spaces.GPU
@@ -94,9 +94,10 @@ def generate_caption(protein, prompt):
94
  'text_input': ['none'],
95
  'prompt': [prompt]}
96
  # Generate the output
97
- prediction = model.generate(samples, length_penalty=0., num_beams=15, num_captions=10, temperature=1., repetition_penalty=1.0)
98
 
99
- return prediction
 
100
 
101
  # Define the FAPM interface
102
  description = """Quick demonstration of the FAPM model for protein function prediction. Upload an protein sequence to generate a function description. Modify the Prompt to provide the taxonomy information.
 
15
  model_esm.to('cuda')
16
 
17
  # Load the model
18
+ # model = Blip2ProteinMistral(config=FAPMConfig(), esm_size='3b')
19
+ # model.load_checkpoint("model/checkpoint_mf2.pth")
20
+ # model.to('cuda')
21
 
22
 
23
  @spaces.GPU
 
94
  'text_input': ['none'],
95
  'prompt': [prompt]}
96
  # Generate the output
97
+ # prediction = model.generate(samples, length_penalty=0., num_beams=15, num_captions=10, temperature=1., repetition_penalty=1.0)
98
 
99
+ # return prediction
100
+ return "test"
101
 
102
  # Define the FAPM interface
103
  description = """Quick demonstration of the FAPM model for protein function prediction. Upload an protein sequence to generate a function description. Modify the Prompt to provide the taxonomy information.