Spaces:
Running on Zero
Running on Zero
Size the GPU reservation by measured cost.
Browse files
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 |
-
|
|
|
|
| 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):
|