hexgrad commited on
Commit
22b8f4b
·
verified ·
1 Parent(s): a6e8f5e

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -246,7 +246,9 @@ def generate(text, voice='af', ps=None, speed=1, trim=3000, use_gpu='auto'):
246
  tokens = tokens[:510]
247
  ps = ''.join(next(k for k, v in VOCAB.items() if i == v) for i in tokens)
248
  use_gpu = len(ps) > 99 if use_gpu == 'auto' else use_gpu
249
- print('🔥', datetime.now(), text, voices, ps, use_gpu)
 
 
250
  try:
251
  if use_gpu:
252
  out = forward_gpu(tokens, voices, speed)
 
246
  tokens = tokens[:510]
247
  ps = ''.join(next(k for k, v in VOCAB.items() if i == v) for i in tokens)
248
  use_gpu = len(ps) > 99 if use_gpu == 'auto' else use_gpu
249
+ is_space = os.environ.get('SPACE_ID') is not None
250
+ is_api_call = os.environ.get('GRADIO_ENDPOINT') is not None
251
+ print('🔥', datetime.now(), text, voices, ps, use_gpu, is_space, is_api_call)
252
  try:
253
  if use_gpu:
254
  out = forward_gpu(tokens, voices, speed)