V4ldeLund commited on
Commit
58606bd
·
verified ·
1 Parent(s): b623968

Pin transformers to commit with SAM3 support

Browse files
Files changed (2) hide show
  1. app.py +5 -1
  2. requirements.txt +1 -1
app.py CHANGED
@@ -32,7 +32,11 @@ def load_sam3(prompt: str, device: str):
32
  Created only inside inference after GPU slice is granted.
33
  """
34
  if SAM3Segmenter is None:
35
- raise gr.Error("SAM3 is unavailable in this Space (transformers build missing Sam3Processor/Sam3Model). Disable the SAM3 option.")
 
 
 
 
36
  return SAM3Segmenter(text_prompt=prompt, device=device)
37
 
38
 
 
32
  Created only inside inference after GPU slice is granted.
33
  """
34
  if SAM3Segmenter is None:
35
+ raise gr.Error(
36
+ "SAM3 is unavailable (transformers build missing Sam3Processor/Sam3Model). "
37
+ "This Space installs transformers from GitHub; if you still see this, restart the Space "
38
+ "to rebuild with the latest image."
39
+ )
40
  return SAM3Segmenter(text_prompt=prompt, device=device)
41
 
42
 
requirements.txt CHANGED
@@ -11,7 +11,7 @@ matplotlib>=3.7.0
11
  scikit-learn>=1.3.0
12
  scipy>=1.10.0
13
  faiss-cpu==1.12.0
14
- git+https://github.com/huggingface/transformers.git
15
  accelerate>=0.30.0
16
  huggingface-hub>=0.23.0
17
  timm>=1.0.10
 
11
  scikit-learn>=1.3.0
12
  scipy>=1.10.0
13
  faiss-cpu==1.12.0
14
+ transformers @ git+https://github.com/huggingface/transformers.git@1fba72361e8e0e865d569f7cd15e5aa50b41ac9a
15
  accelerate>=0.30.0
16
  huggingface-hub>=0.23.0
17
  timm>=1.0.10