AdrianM0 commited on
Commit
21ea065
·
verified ·
1 Parent(s): 9bd549c

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +0 -5
app.py CHANGED
@@ -9,7 +9,6 @@ import logging
9
  from tokenizers import Tokenizer
10
  from huggingface_hub import hf_hub_download
11
  import gc
12
- import math # Potentially needed by imported classes
13
 
14
  # --- Configuration ---
15
  MODEL_REPO_ID = (
@@ -440,10 +439,6 @@ def predict_iupac(smiles_string):
440
 
441
  except RuntimeError as e:
442
  logging.error(f"Runtime error during translation: {e}", exc_info=True)
443
- error_msg = f"Runtime Error during translation: {e}"
444
- if "memory" in str(e).lower():
445
- gc.collect(); torch.cuda.empty_cache() if device.type == "cuda" else None
446
- error_msg += " (Potential OOM)"
447
  return f"Error: {error_msg}" # Return single error string
448
 
449
  except Exception as e:
 
9
  from tokenizers import Tokenizer
10
  from huggingface_hub import hf_hub_download
11
  import gc
 
12
 
13
  # --- Configuration ---
14
  MODEL_REPO_ID = (
 
439
 
440
  except RuntimeError as e:
441
  logging.error(f"Runtime error during translation: {e}", exc_info=True)
 
 
 
 
442
  return f"Error: {error_msg}" # Return single error string
443
 
444
  except Exception as e: