ASG Models commited on
Commit
9ba5fd1
1 Parent(s): 69624fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -114,7 +114,7 @@ class DataViewerApp:
114
 
115
 
116
  self.sdata[self.current_selected] = audio
117
- return self.get_page_data(self.current_page)
118
  def GetDataset_2(self,filename,ds=1.5):
119
  audios_data = []
120
  audios_samplerate = []
@@ -163,7 +163,7 @@ class DataViewerApp:
163
  self.df = pd.concat([self.df, df], axis=0, ignore_index=True)
164
  self.data =self.df[['text','speaker_id','secs','flag']]
165
  self.sdata =self.df['audio'].to_list()
166
- return self.get_page_data(self.current_page)
167
  def order_data(self):
168
  self.df[['text','speaker_id','secs','flag']]=self.data
169
  self.df=self.df.sort_values(by=['flag'], ascending=False)
@@ -270,7 +270,7 @@ class DataViewerApp:
270
  # self.audio_player.update(None) # Clear audio player
271
  # self.txt_audio.update("") # Clear text input
272
 
273
- return self.get_page_data(self.current_page)
274
  def login(self, token):
275
  # Your actual login logic here (e.g., database check)
276
  if token == os.environ.get("token_login") :
@@ -461,13 +461,13 @@ class DataViewerApp:
461
  self.column_dropdown11.change(self.on_column_dropdown_change_operater,[self.column_dropdown1,self.column_dropdown11], [self.data_table])
462
  self.btn_convertDataset.click(self.Convert_DataFreme_To_DataSet,[self.txt_dataset],[self.label_dataset])
463
  self.totext.click(lambda:self.get_text_from_audio(self.get_output_audio()), [], self.txt_audio)
464
- self.btn_newsave.click(self.trim_audio,[self.txt_audio,self.audio_player],[self.data_table])
465
- self.btn_save.click(self.save_row, [self.txt_audio,self.audio_player], [self.data_table])
466
  #self.btn_save.click(self.save_row, [self.txt_audio,self.audio_player], [self.data_table])
467
  self.btn_all_enhance.click(self.All_enhance,[],[self.data_table])
468
  #self.btn_enhance.click(remove_nn, [self.audio_player], [self.audio_player])
469
  self.but_cleartxt.click(self.clear_txt,[],[self.data_table])
470
- self.btn_del.click(self.delete_row,[], [self.data_table])
471
  self.btn_enhance.click(lambda: remove_nn(self.get_output_audio()), [], self.audio_player)
472
  #self.column_dropdown.change(lambda selected_column:self.settt(self.on_column_dropdown_change(selected_column)), [self.column_dropdown], [self.data_table])
473
  #self.column_dropdown.change(lambda selected_column:self.settt(x.on_column_dropdown_change(selected_column)), [x.column_dropdown], [self.data_table])
 
114
 
115
 
116
  self.sdata[self.current_selected] = audio
117
+ return self.get_page_data(self.current_page),None,""
118
  def GetDataset_2(self,filename,ds=1.5):
119
  audios_data = []
120
  audios_samplerate = []
 
163
  self.df = pd.concat([self.df, df], axis=0, ignore_index=True)
164
  self.data =self.df[['text','speaker_id','secs','flag']]
165
  self.sdata =self.df['audio'].to_list()
166
+ return self.get_page_data(self.current_page),None,""
167
  def order_data(self):
168
  self.df[['text','speaker_id','secs','flag']]=self.data
169
  self.df=self.df.sort_values(by=['flag'], ascending=False)
 
270
  # self.audio_player.update(None) # Clear audio player
271
  # self.txt_audio.update("") # Clear text input
272
 
273
+ return self.get_page_data(self.current_page),None,""
274
  def login(self, token):
275
  # Your actual login logic here (e.g., database check)
276
  if token == os.environ.get("token_login") :
 
461
  self.column_dropdown11.change(self.on_column_dropdown_change_operater,[self.column_dropdown1,self.column_dropdown11], [self.data_table])
462
  self.btn_convertDataset.click(self.Convert_DataFreme_To_DataSet,[self.txt_dataset],[self.label_dataset])
463
  self.totext.click(lambda:self.get_text_from_audio(self.get_output_audio()), [], self.txt_audio)
464
+ self.btn_newsave.click(self.trim_audio,[self.txt_audio,self.audio_player],[self.data_table,self.audio_player,self.txt_audio])
465
+ self.btn_save.click(self.save_row, [self.txt_audio,self.audio_player], [self.data_table,self.audio_player,self.txt_audio])
466
  #self.btn_save.click(self.save_row, [self.txt_audio,self.audio_player], [self.data_table])
467
  self.btn_all_enhance.click(self.All_enhance,[],[self.data_table])
468
  #self.btn_enhance.click(remove_nn, [self.audio_player], [self.audio_player])
469
  self.but_cleartxt.click(self.clear_txt,[],[self.data_table])
470
+ self.btn_del.click(self.delete_row,[], [self.data_table,self.audio_player,self.txt_audio])
471
  self.btn_enhance.click(lambda: remove_nn(self.get_output_audio()), [], self.audio_player)
472
  #self.column_dropdown.change(lambda selected_column:self.settt(self.on_column_dropdown_change(selected_column)), [self.column_dropdown], [self.data_table])
473
  #self.column_dropdown.change(lambda selected_column:self.settt(x.on_column_dropdown_change(selected_column)), [x.column_dropdown], [self.data_table])