laxsvips commited on
Commit
685fda7
·
1 Parent(s): 061620e

Update audio.py

Browse files
Files changed (1) hide show
  1. audio.py +5 -12
audio.py CHANGED
@@ -41,18 +41,11 @@ def generate_voice(text):
41
  save(audio,'data/audio.mp4')
42
  save(audio,'audio.mp4')
43
  commit_url = repo.push_to_hub()
44
- # commit_url = api.upload_file(
45
- # DATA_FILE,
46
- # path_in_repo=DATA_FILENAME,
47
- # repo_id=DATASET_REPO_ID,
48
- # repo_type="dataset"
49
- # )
50
- # api.upload_file(
51
- # folder_path="./data",
52
- # repo_id=DATASET_REPO_ID,
53
- # repo_type="dataset",
54
- # )
55
- return (commit_url)
56
  # return (44100, np.frombuffer(pad_buffer(audio), dtype=np.int16))
57
  except UnauthenticatedRateLimitError as e:
58
  raise gr.Error("Thanks for trying out ElevenLabs TTS! You've reached the free tier limit. Please provide an API key to continue.")
 
41
  save(audio,'data/audio.mp4')
42
  save(audio,'audio.mp4')
43
  commit_url = repo.push_to_hub()
44
+ return_url = "failure"
45
+ if commit_url:
46
+ return_url = DATASET_REPO_URL+"/"+ DATA_FILENAME
47
+
48
+ return (return_url)
 
 
 
 
 
 
 
49
  # return (44100, np.frombuffer(pad_buffer(audio), dtype=np.int16))
50
  except UnauthenticatedRateLimitError as e:
51
  raise gr.Error("Thanks for trying out ElevenLabs TTS! You've reached the free tier limit. Please provide an API key to continue.")