harp-dev commited on
Commit
b9dda3d
·
verified ·
1 Parent(s): eefbd1f

Size the GPU reservation by measured cost.

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -102,7 +102,8 @@ def generate_midi(prompt: str, temperature: float = 0.9, max_len: int = 500) ->
102
  return midi_path
103
 
104
  def gpu_seconds(prompt: str, temperature: float, max_length: int) -> float:
105
- return 15 + 0.1 * int(max_length)
 
106
 
107
 
108
  def process_fn(prompt: str, temperature: float, max_length: int):
 
102
  return midi_path
103
 
104
  def gpu_seconds(prompt: str, temperature: float, max_length: int) -> float:
105
+ # Measured at about 42 s for the longest, 1500 tokens, padded
106
+ return 10 + 0.05 * int(max_length)
107
 
108
 
109
  def process_fn(prompt: str, temperature: float, max_length: int):