Spaces:
Running
on
Zero
Running
on
Zero
asigalov61
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,10 @@ print('Loading core Giant Music Transformer modules...')
|
|
8 |
import os
|
9 |
import sys
|
10 |
|
|
|
|
|
|
|
|
|
11 |
print('=' * 70)
|
12 |
print('Loading main Giant Music Transformer modules...')
|
13 |
|
@@ -369,6 +373,10 @@ def generate_callback_wrapper(input_midi,
|
|
369 |
model_temperature,
|
370 |
model_sampling_top_p
|
371 |
):
|
|
|
|
|
|
|
|
|
372 |
|
373 |
result = generate_callback(input_midi,
|
374 |
num_prime_tokens,
|
@@ -380,6 +388,12 @@ def generate_callback_wrapper(input_midi,
|
|
380 |
)
|
381 |
|
382 |
generated_batches.extend([sublist[2] for sublist in result])
|
|
|
|
|
|
|
|
|
|
|
|
|
383 |
|
384 |
return tuple(item for sublist in result for item in sublist[:2])
|
385 |
|
|
|
8 |
import os
|
9 |
import sys
|
10 |
|
11 |
+
import time as reqtime
|
12 |
+
import datetime
|
13 |
+
from pytz import timezone
|
14 |
+
|
15 |
print('=' * 70)
|
16 |
print('Loading main Giant Music Transformer modules...')
|
17 |
|
|
|
373 |
model_temperature,
|
374 |
model_sampling_top_p
|
375 |
):
|
376 |
+
|
377 |
+
print('=' * 70)
|
378 |
+
print('Req start time: {:%Y-%m-%d %H:%M:%S}'.format(datetime.datetime.now(PDT)))
|
379 |
+
start_time = reqtime.time()
|
380 |
|
381 |
result = generate_callback(input_midi,
|
382 |
num_prime_tokens,
|
|
|
388 |
)
|
389 |
|
390 |
generated_batches.extend([sublist[2] for sublist in result])
|
391 |
+
|
392 |
+
print('=' * 70)
|
393 |
+
print('Req end time: {:%Y-%m-%d %H:%M:%S}'.format(datetime.datetime.now(PDT)))
|
394 |
+
print('=' * 70)
|
395 |
+
print('Req execution time:', (reqtime.time() - start_time), 'sec')
|
396 |
+
print('*' * 70)
|
397 |
|
398 |
return tuple(item for sublist in result for item in sublist[:2])
|
399 |
|