laxsvips commited on
Commit
6fe06f9
·
1 Parent(s): 1babcd6

Update audio.py

Browse files
Files changed (1) hide show
  1. audio.py +5 -3
audio.py CHANGED
@@ -6,10 +6,11 @@ from huggingface_hub import Repository
6
  import os
7
  from huggingface_hub import HfApi
8
  import gradio as gr
 
9
 
10
 
11
  DATASET_REPO_URL = "https://huggingface.co/datasets/laxsvips/audiofiles"
12
- DATA_FILENAME = "audio.wav"
13
  DATA_FILE = os.path.join("data", DATA_FILENAME)
14
 
15
  api = HfApi()
@@ -36,9 +37,10 @@ def generate_voice(text):
36
  voice="Arnold",
37
  model="eleven_monolingual_v1"
38
  )
39
- save(audio,'data/audio.wav')
40
  # save(audio,'audio.wav')
41
- commit_url = repo.push_to_hub()
 
42
  return_url = "failure"
43
  if commit_url:
44
  return_url = DATASET_REPO_URL+"/"+ DATA_FILENAME
 
6
  import os
7
  from huggingface_hub import HfApi
8
  import gradio as gr
9
+ from datasets import load_dataset
10
 
11
 
12
  DATASET_REPO_URL = "https://huggingface.co/datasets/laxsvips/audiofiles"
13
+ DATA_FILENAME = "audio.mp3"
14
  DATA_FILE = os.path.join("data", DATA_FILENAME)
15
 
16
  api = HfApi()
 
37
  voice="Arnold",
38
  model="eleven_monolingual_v1"
39
  )
40
+ save(audio,'data/audio.mp3')
41
  # save(audio,'audio.wav')
42
+ # commit_url = repo.push_to_hub()
43
+ dataset = load_dataset("audiofolder", data_dir="./data")
44
  return_url = "failure"
45
  if commit_url:
46
  return_url = DATASET_REPO_URL+"/"+ DATA_FILENAME