hanashi v2, include cnn entertainment feed

This commit is contained in:
Brandon Thomas committed 2023-02-19 06:35:22 -05:00
1 parent ab6e3ceb5a
commit 1e7de6bf36
5 files changed
+16 -7

No files matched your search

@@ -14,12 +14,15 @@ const RSS_US : &'static str = "http://rss.cnn.com/rss/cnn_us.rss";
const RSS_TECH : &'static str = "http://rss.cnn.com/rss/cnn_tech.rss";
const RSS_ENTERTAINMENT : &'static str = "http://rss.cnn.com/rss/cnn_showbiz.rss";
#[derive(Copy, Clone, Debug, EnumIter, EnumCount)]
pub enum CnnFeed {
TopStories,
World,
UnitedStates,
Tech,
Entertainment,
}
impl CnnFeed {
@@ -29,6 +32,7 @@ impl CnnFeed {
Self::World => RSS_WORLD,
Self::UnitedStates => RSS_US,
Self::Tech => RSS_TECH,
Self::Entertainment => RSS_ENTERTAINMENT,
}
}
}
@@ -4,7 +4,10 @@ use tokens::tokens::tts_models::TtsModelToken;
/// These will be well-known character voices, test voices, etc.
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
pub enum FakeYouVoiceOption {
Hanashi,
HanashiV2,
// NB: Hanashi v1 has strokes.
HanashiV1,
// NB: John Madden is fantastic.
JohnMadden,
}
@@ -12,14 +15,16 @@ impl FakeYouVoiceOption {
pub fn variant_name(&self) -> &'static str {
match self {
FakeYouVoiceOption::Hanashi => "Hanashi",
FakeYouVoiceOption::HanashiV2 => "Hanashi (v2)",
FakeYouVoiceOption::HanashiV1 => "Hanashi (v1)",
FakeYouVoiceOption::JohnMadden => "John Madden",
}
}
pub fn tts_model_token_str(&self) -> &'static str {
match self {
FakeYouVoiceOption::Hanashi => "TM:npxv6rgtddmv",
FakeYouVoiceOption::HanashiV2 => "TM:zcd4qzrwacq0",
FakeYouVoiceOption::HanashiV1 => "TM:npxv6rgtddmv",
FakeYouVoiceOption::JohnMadden => "TM:30ha2t6bxfn4",
}
}
@@ -39,7 +39,7 @@ impl AppGui {
is_scraping_paused: false,
is_openai_paused: false,
is_fakeyou_paused: false,
fakeyou_voice: FakeYouVoiceOption::Hanashi,
fakeyou_voice: FakeYouVoiceOption::HanashiV2,
control_state: args.control_state,
}
}
@@ -105,7 +105,7 @@ impl eframe::App for AppGui {
egui::ComboBox::from_label("Note: once a story is generated, it will not be re-voiced!")
.selected_text(format!("{:?}", self.fakeyou_voice))
.show_ui(ui, |ui| {
ui.selectable_value(&mut self.fakeyou_voice, FakeYouVoiceOption::Hanashi, FakeYouVoiceOption::Hanashi.variant_name());
ui.selectable_value(&mut self.fakeyou_voice, FakeYouVoiceOption::HanashiV2, FakeYouVoiceOption::HanashiV2.variant_name());
ui.selectable_value(&mut self.fakeyou_voice, FakeYouVoiceOption::JohnMadden, FakeYouVoiceOption::JohnMadden.variant_name());
});
@@ -35,7 +35,7 @@ impl AppControlState {
is_scraping_paused: RelaxedAtomicBool::new(false),
is_openai_paused: RelaxedAtomicBool::new(false),
is_fakeyou_paused: RelaxedAtomicBool::new(false),
fakeyou_voice: Arc::new(RwLock::new(FakeYouVoiceOption::Hanashi)),
fakeyou_voice: Arc::new(RwLock::new(FakeYouVoiceOption::HanashiV2)),
}
}
@@ -49,7 +49,7 @@ pub async fn process_single_item(target: &NewsStoryProductionItem, job_state: &A
let tts_model_token = job_state.app_control_state
.fakeyou_voice()
.unwrap_or(FakeYouVoiceOption::Hanashi)
.unwrap_or(FakeYouVoiceOption::HanashiV2)
.tts_model_token();
let sequence_length = paragraphs.len() as i64;