Oopstom commited on
Commit
8fa7790
·
1 Parent(s): 73028bf
__pycache__/e_smiles.cpython-310.pyc ADDED
Binary file (67.4 kB). View file
 
app.py CHANGED
@@ -3,6 +3,7 @@ import gradio as gr
3
  from rdkit import Chem
4
  from rdkit.Chem import Draw
5
  import os
 
6
  import torch
7
  try:
8
  print(f"Is CUDA available: {torch.cuda.is_available()}")
@@ -10,7 +11,8 @@ try:
10
  print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
11
  # Tesla T4
12
  except:
13
- pass
 
14
 
15
  def remove_atom_mapping_and_isotopes(smiles):
16
  mol = Chem.MolFromSmiles(smiles)
 
3
  from rdkit import Chem
4
  from rdkit.Chem import Draw
5
  import os
6
+ import spaces
7
  import torch
8
  try:
9
  print(f"Is CUDA available: {torch.cuda.is_available()}")
 
11
  print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
12
  # Tesla T4
13
  except:
14
+ print("No GPU found!")
15
+
16
 
17
  def remove_atom_mapping_and_isotopes(smiles):
18
  mol = Chem.MolFromSmiles(smiles)
infer.sh CHANGED
@@ -7,4 +7,5 @@ python inference.py \
7
  --batch_size 16384 \
8
  --batch_type tokens \
9
  --max_length 500 \
10
- --seed 0
 
 
7
  --batch_size 16384 \
8
  --batch_type tokens \
9
  --max_length 500 \
10
+ --seed 0 \
11
+ --gpu 0
onmt/bin/translate.py CHANGED
@@ -9,6 +9,7 @@ from onmt.constants import CorpusTask
9
  import onmt.opts as opts
10
  from onmt.utils.parse import ArgumentParser
11
  from onmt.utils.misc import use_gpu, set_random_seed
 
12
 
13
 
14
  def translate(opt):
@@ -49,7 +50,7 @@ def _get_parser():
49
  opts.translate_opts(parser, dynamic=True)
50
  return parser
51
 
52
-
53
  def main():
54
  parser = _get_parser()
55
  opt = parser.parse_args()
 
9
  import onmt.opts as opts
10
  from onmt.utils.parse import ArgumentParser
11
  from onmt.utils.misc import use_gpu, set_random_seed
12
+ import spaces
13
 
14
 
15
  def translate(opt):
 
50
  opts.translate_opts(parser, dynamic=True)
51
  return parser
52
 
53
+ @spaces.GPU
54
  def main():
55
  parser = _get_parser()
56
  opt = parser.parse_args()