Hyacinthax commited on
Commit
d35be68
·
verified ·
1 Parent(s): b7373ca

Fixed user_yes

Browse files

Debugged user_yes and removed errors

Files changed (1) hide show
  1. runCorpus.py +8 -4
runCorpus.py CHANGED
@@ -85,6 +85,10 @@ class CorpusTrainer:
85
  speaker = str(randomconvo)
86
  dialog_pairs = self.processed_dialogs[speaker]
87
 
 
 
 
 
88
  # Input conversation data into input and target data from dialog pairs
89
  for input_text, target_text in dialog_pairs:
90
  if input_text != "" and target_text != "":
@@ -179,8 +183,8 @@ class CorpusTrainer:
179
  if answer_2 in self.exit_commands:
180
  quit()
181
  save_file = True if answer_1 in self.choices_yes else False
182
- self.log_failures(len(self.troubleList), log_file, show_file=show_file, save_file=save_file)
183
- self.plot_failures(log_file)
184
  print("Plotting Failures... See failures_plot.png for more information... ")
185
  # Clear Speakers
186
  delete_speakers = input("Would you like to clear trained_speakers.txt? \nThis is useful for touching on successful conversations... \n>")
@@ -238,9 +242,9 @@ class CorpusTrainer:
238
  if percent_running is not None:
239
  # Note: The self.run adds to the trained speaker list which is successful trainings. If it's not in that list, when it comes up again it will be trained another time.
240
  if percent_running > self.percent_reset:
241
- self.log_failures(len(self.troubleList), log_file)
242
  print("Plotting Failures... See failures_plot.png for more information... ")
243
- self.plot_failures(log_file)
244
  if play_notification == 1:
245
  playsound(notification_sound)
246
  print(f"Resetting... Failure Rate is Greater than {self.percent_reset}%... For this self.run.")
 
85
  speaker = str(randomconvo)
86
  dialog_pairs = self.processed_dialogs[speaker]
87
 
88
+ if len(dialog_pairs) < 3:
89
+ print(f"Conversation {speaker} skipped for NOT providing enough data... ")
90
+ continue
91
+
92
  # Input conversation data into input and target data from dialog pairs
93
  for input_text, target_text in dialog_pairs:
94
  if input_text != "" and target_text != "":
 
183
  if answer_2 in self.exit_commands:
184
  quit()
185
  save_file = True if answer_1 in self.choices_yes else False
186
+ self.log_failures(len(self.troubleList), self.log_file)
187
+ self.plot_failures(self.log_file, show_file=show_file, save_file=save_file)
188
  print("Plotting Failures... See failures_plot.png for more information... ")
189
  # Clear Speakers
190
  delete_speakers = input("Would you like to clear trained_speakers.txt? \nThis is useful for touching on successful conversations... \n>")
 
242
  if percent_running is not None:
243
  # Note: The self.run adds to the trained speaker list which is successful trainings. If it's not in that list, when it comes up again it will be trained another time.
244
  if percent_running > self.percent_reset:
245
+ self.log_failures(len(self.troubleList), self.log_file)
246
  print("Plotting Failures... See failures_plot.png for more information... ")
247
+ self.plot_failures(self.log_file)
248
  if play_notification == 1:
249
  playsound(notification_sound)
250
  print(f"Resetting... Failure Rate is Greater than {self.percent_reset}%... For this self.run.")