Daye-Lee18 commited on
Commit
efcaecd
·
1 Parent(s): a30a67a
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -3,6 +3,7 @@ import tempfile
3
  from pathlib import Path
4
  from typing import Tuple, Optional
5
 
 
6
  import gradio as gr
7
  import numpy as np
8
  import torch
@@ -24,7 +25,7 @@ DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
24
  # -----------------------------
25
  # Secure download + load
26
  # -----------------------------
27
- @gr.cache_resource
28
  def load_model():
29
  """
30
  Loads model weights from a PRIVATE HF repo using HF_TOKEN (Space Secret).
 
3
  from pathlib import Path
4
  from typing import Tuple, Optional
5
 
6
+ from functools import lru_cache
7
  import gradio as gr
8
  import numpy as np
9
  import torch
 
25
  # -----------------------------
26
  # Secure download + load
27
  # -----------------------------
28
+ @lru_cache
29
  def load_model():
30
  """
31
  Loads model weights from a PRIVATE HF repo using HF_TOKEN (Space Secret).