Wauplin HF Staff commited on
Commit
cf05e76
·
verified ·
1 Parent(s): 23ae9eb

pin transformers to PR #45547 merge commit (auto-detect disable_mmap on hf-mount)

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -39,13 +39,10 @@ def _profile():
39
  STATS["processor_load_seconds"] = t1 - t0
40
 
41
  t2 = time.time()
42
- _from_pretrained_kwargs = {"dtype": "auto", "device_map": "auto"}
43
- if os.environ.get("DISABLE_MMAP", "1") == "1":
44
- _from_pretrained_kwargs["disable_mmap"] = True
45
- STATS["from_pretrained_kwargs"] = {k: str(v) for k, v in _from_pretrained_kwargs.items()}
46
  model = AutoModelForImageTextToText.from_pretrained(
47
  MODEL_SOURCE,
48
- **_from_pretrained_kwargs,
 
49
  )
50
  t3 = time.time()
51
  STATS["model_load_seconds"] = t3 - t2
 
39
  STATS["processor_load_seconds"] = t1 - t0
40
 
41
  t2 = time.time()
 
 
 
 
42
  model = AutoModelForImageTextToText.from_pretrained(
43
  MODEL_SOURCE,
44
+ dtype="auto",
45
+ device_map="auto",
46
  )
47
  t3 = time.time()
48
  STATS["model_load_seconds"] = t3 - t2