Spaces:
Sleeping
Sleeping
ASG Models
commited on
Commit
•
ff11af3
1
Parent(s):
4f56ea6
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ from gradio.themes.base import Base
|
|
11 |
|
12 |
|
13 |
def Read_DataSet(link):
|
14 |
-
dataset =
|
15 |
df = dataset["train"].to_pandas()
|
16 |
return df
|
17 |
|
@@ -23,6 +23,7 @@ def remove_nn(wav, sample_rate=16000):
|
|
23 |
save_audio("enhanced.wav", enhanced, df_state.sr())
|
24 |
audiodata, samplerate = librosa.load("enhanced.wav", sr=16000)
|
25 |
return 16000, audiodata
|
|
|
26 |
class DataViewerApp:
|
27 |
def __init__(self,df):
|
28 |
#df=Read_DataSet(link)
|
@@ -60,6 +61,7 @@ class DataViewerApp:
|
|
60 |
v=self.settt(df)
|
61 |
return self.get_page_data(self.current_page),len(v)
|
62 |
def getdataset(self,link):
|
|
|
63 |
df=Read_DataSet(link)
|
64 |
v=self.settt(df)
|
65 |
return self.get_page_data(self.current_page),len(v)
|
@@ -225,14 +227,13 @@ class DataViewerApp:
|
|
225 |
eval_df =df.sample(1,random_state=42)
|
226 |
|
227 |
ds = {
|
228 |
-
"train": Dataset.from_pandas(train_df)
|
229 |
-
|
230 |
-
"full_generation":Dataset.from_pandas(eval_df)
|
231 |
}
|
232 |
|
233 |
dataset = DatasetDict(ds)
|
234 |
dirr='/content/drive/MyDrive/vitsM/DATA/sata/'+namedata
|
235 |
-
dataset.
|
236 |
return dirr
|
237 |
|
238 |
def delete_row(self):
|
|
|
11 |
|
12 |
|
13 |
def Read_DataSet(link):
|
14 |
+
dataset = load_dataset(link,token=os.environ.get("auth_acess_data"))
|
15 |
df = dataset["train"].to_pandas()
|
16 |
return df
|
17 |
|
|
|
23 |
save_audio("enhanced.wav", enhanced, df_state.sr())
|
24 |
audiodata, samplerate = librosa.load("enhanced.wav", sr=16000)
|
25 |
return 16000, audiodata
|
26 |
+
from datasets import load_dataset
|
27 |
class DataViewerApp:
|
28 |
def __init__(self,df):
|
29 |
#df=Read_DataSet(link)
|
|
|
61 |
v=self.settt(df)
|
62 |
return self.get_page_data(self.current_page),len(v)
|
63 |
def getdataset(self,link):
|
64 |
+
self.link_dataset=link
|
65 |
df=Read_DataSet(link)
|
66 |
v=self.settt(df)
|
67 |
return self.get_page_data(self.current_page),len(v)
|
|
|
227 |
eval_df =df.sample(1,random_state=42)
|
228 |
|
229 |
ds = {
|
230 |
+
"train": Dataset.from_pandas(train_df)
|
231 |
+
|
|
|
232 |
}
|
233 |
|
234 |
dataset = DatasetDict(ds)
|
235 |
dirr='/content/drive/MyDrive/vitsM/DATA/sata/'+namedata
|
236 |
+
dataset.push_to_hub(self.link_dataset,token=os.environ.get("auth_acess_data"))
|
237 |
return dirr
|
238 |
|
239 |
def delete_row(self):
|