Erinaldorodrigues commited on
Commit
cac816b
·
verified ·
1 Parent(s): b7e1b13

Allow GPU duration hook to receive tools

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -63,7 +63,12 @@ def _bounded_output_tokens(value: float) -> int:
63
  return max(1, min(requested, MAX_NEW_TOKENS))
64
 
65
 
66
- def _gpu_duration(_: str, __: float, max_new_tokens: float) -> int:
 
 
 
 
 
67
  """Reserve only the GPU time that the requested output can plausibly use."""
68
  output_tokens = _bounded_output_tokens(max_new_tokens)
69
  return min(120, max(30, 20 + math.ceil(output_tokens * 0.08)))
 
63
  return max(1, min(requested, MAX_NEW_TOKENS))
64
 
65
 
66
+ def _gpu_duration(
67
+ _: str,
68
+ __: float,
69
+ max_new_tokens: float,
70
+ *_tools: object,
71
+ ) -> int:
72
  """Reserve only the GPU time that the requested output can plausibly use."""
73
  output_tokens = _bounded_output_tokens(max_new_tokens)
74
  return min(120, max(30, 20 + math.ceil(output_tokens * 0.08)))