File size: 1,077 Bytes
7a6a652
 
 
730125d
06663d0
7a6a652
 
 
 
 
 
 
 
 
 
 
 
 
 
 
872b7a2
7a6a652
 
 
 
 
 
 
 
 
872b7a2
7a6a652
 
fcb84b9
7a6a652
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import pandas as pd
import gradio as gr

csv_link = "https://huggingface.co/datasets/jerpint/vox-cloned-data/resolve/main/metadata-balanced.csv?download=true"
models = ["commonvoice", "xttsv2", "stylettsv2", "playht", "metavoice"]


def audio_markdown(x, model: str):

    link = f"https://huggingface.co/datasets/jerpint/vox-cloned-data/resolve/main/{model}/{x.path}?download=true"

    audio_md = f"""<audio controls>
      <source src="{link}" type="audio/mpeg">
      Your browser does not support the audio element.
  </audio>"""

    return audio_md


df = pd.read_csv(csv_link)
df["id"] = list(df.index)  # Temporary id to visualize the index on the UI

for model in models:
    df[model] = df.apply(lambda x: audio_markdown(x, model), axis=1)


with gr.Blocks() as demo:
    gr.Dataframe(
        value=df[
            [
                "id",
                *models,
                "path",
                "sentence",
                "gender",
                "accents",
            ]
        ],
        datatype="markdown",
        row_count=10,
    )

demo.launch()