FanLR commited on
Commit
2222d22
·
verified ·
1 Parent(s): 019a613

Use a 60-second default GPU lease

Browse files

Align the documented and default GPU lease with the Space setting of 60 seconds. Avoid rejecting short inference requests because of a 120-second maximum lease reservation. Preserve maximum generation tokens, native model inference and original English UI. Local 51 tests pass.

.env.example CHANGED
@@ -3,7 +3,7 @@ GROUNDING_BACKEND=zerogpu
3
  GROUNDING_MODEL_REPO=GroundingPI/GroundingPI
4
  GROUNDING_MODEL_REVISION=127b0e1c54c68f24bf769a80067521b815b695dd
5
  GROUNDING_MAX_TOKENS=1024
6
- GROUNDING_GPU_SECONDS=120
7
 
8
  # For a private/gated model, put HF_TOKEN in Settings -> Secrets, not this file.
9
  # Local CUDA test alternative: unset REPO/REVISION and set GROUNDING_MODEL_PATH.
 
3
  GROUNDING_MODEL_REPO=GroundingPI/GroundingPI
4
  GROUNDING_MODEL_REVISION=127b0e1c54c68f24bf769a80067521b815b695dd
5
  GROUNDING_MAX_TOKENS=1024
6
+ GROUNDING_GPU_SECONDS=60
7
 
8
  # For a private/gated model, put HF_TOKEN in Settings -> Secrets, not this file.
9
  # Local CUDA test alternative: unset REPO/REVISION and set GROUNDING_MODEL_PATH.
grounding_demo/zerogpu_backend.py CHANGED
@@ -22,7 +22,7 @@ except Exception as exc:
22
  import traceback
23
  traceback.print_exc()
24
 
25
- GPU_SECONDS = int(os.getenv("GROUNDING_GPU_SECONDS", "120"))
26
  if not 1 <= GPU_SECONDS <= 120:
27
  raise ConfigurationError("GROUNDING_GPU_SECONDS must be between 1 and 120.")
28
 
 
22
  import traceback
23
  traceback.print_exc()
24
 
25
+ GPU_SECONDS = int(os.getenv("GROUNDING_GPU_SECONDS", "60"))
26
  if not 1 <= GPU_SECONDS <= 120:
27
  raise ConfigurationError("GROUNDING_GPU_SECONDS must be between 1 and 120.")
28