Zaixi commited on
Commit
27913f1
·
1 Parent(s): 194acd2
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import logging
2
  import gradio as gr
3
  import os
@@ -19,7 +20,6 @@ import tempfile
19
  import shutil
20
  from Bio import PDB
21
  from gradio_molecule3d import Molecule3D
22
- #import spaces # Import spaces for ZeroGPU compatibility
23
 
24
  EXAMPLE_PATH = './examples/example.json'
25
  example_json=[{'sequences': [{'proteinChain': {'sequence': 'MAEVIRSSAFWRSFPIFEEFDSETLCELSGIASYRKWSAGTVIFQRGDQGDYMIVVVSGRIKLSLFTPQGRELMLRQHEAGALFGEMALLDGQPRSADATAVTAAEGYVIGKKDFLALITQRPKTAEAVIRFLCAQLRDTTDRLETIALYDLNARVARFFLATLRQIHGSEMPQSANLRLTLSQTDIASILGASRPKVNRAILSLEESGAIKRADGIICCNVGRLLSIADPEEDLEHHHHHHHH', 'count': 2}}, {'dnaSequence': {'sequence': 'CTAGGTAACATTACTCGCG', 'count': 2}}, {'dnaSequence': {'sequence': 'GCGAGTAATGTTAC', 'count': 2}}, {'ligand': {'ligand': 'CCD_PCG', 'count': 2}}], 'name': '7pzb_need_search_msa'}]
@@ -210,7 +210,7 @@ def create_protenix_json(input_data: Dict) -> List[Dict]:
210
 
211
 
212
  #@torch.inference_mode()
213
- #@spaces.GPU(duration=120) # Specify a duration to avoid timeout
214
  def predict_structure(input_collector: dict):
215
  """Handle both input types"""
216
  os.makedirs("./output", exist_ok=True)
@@ -451,7 +451,7 @@ with gr.Blocks(title="FoldMark", css=custom_css) as demo:
451
  outputs=[view3d, confidence_plot_image, cif_file]
452
  )
453
 
454
- #@spaces.GPU
455
  def is_watermarked(file):
456
  # Generate a unique subdirectory and filename
457
  unique_id = str(uuid.uuid4().hex[:8])
 
1
+ import spaces
2
  import logging
3
  import gradio as gr
4
  import os
 
20
  import shutil
21
  from Bio import PDB
22
  from gradio_molecule3d import Molecule3D
 
23
 
24
  EXAMPLE_PATH = './examples/example.json'
25
  example_json=[{'sequences': [{'proteinChain': {'sequence': 'MAEVIRSSAFWRSFPIFEEFDSETLCELSGIASYRKWSAGTVIFQRGDQGDYMIVVVSGRIKLSLFTPQGRELMLRQHEAGALFGEMALLDGQPRSADATAVTAAEGYVIGKKDFLALITQRPKTAEAVIRFLCAQLRDTTDRLETIALYDLNARVARFFLATLRQIHGSEMPQSANLRLTLSQTDIASILGASRPKVNRAILSLEESGAIKRADGIICCNVGRLLSIADPEEDLEHHHHHHHH', 'count': 2}}, {'dnaSequence': {'sequence': 'CTAGGTAACATTACTCGCG', 'count': 2}}, {'dnaSequence': {'sequence': 'GCGAGTAATGTTAC', 'count': 2}}, {'ligand': {'ligand': 'CCD_PCG', 'count': 2}}], 'name': '7pzb_need_search_msa'}]
 
210
 
211
 
212
  #@torch.inference_mode()
213
+ @spaces.GPU(duration=120) # Specify a duration to avoid timeout
214
  def predict_structure(input_collector: dict):
215
  """Handle both input types"""
216
  os.makedirs("./output", exist_ok=True)
 
451
  outputs=[view3d, confidence_plot_image, cif_file]
452
  )
453
 
454
+ @spaces.GPU
455
  def is_watermarked(file):
456
  # Generate a unique subdirectory and filename
457
  unique_id = str(uuid.uuid4().hex[:8])