Skip to content

Commit

Permalink
placeholder of openai like server interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jan 15, 2025
1 parent a90eb86 commit 1778be2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
28 changes: 18 additions & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mod onn;
mod serve;
mod tts;
mod utils;

Expand All @@ -12,21 +13,28 @@ use tts::koko::TTSKoko;
struct Cli {
#[arg(short = 't', long = "text", value_name = "TEXT")]
text: Option<String>,

#[arg(long = "oai", value_name = "OpenAI server")]
oai: bool,
}

fn main() {
let args = Cli::parse();

let txt = args.text.unwrap_or_else(|| {
r#"
Hello, This is Kokoro. Your amazing AI TTS! A TTS model with only 82 million parameters that achieve incredible audio quality.
This is the one of the best Rust inference, I help you will like it.
Please give us a star if you do, thank you very much.
"#
.to_string()
});
if args.oai {
println!("OpenAI like server still need help!")
} else {
let txt = args.text.unwrap_or_else(|| {
r#"
Hello, This is Kokoro. Your amazing AI TTS! A TTS model with only 82 million parameters that achieve incredible audio quality.
This is the one of the best Rust inference, I help you will like it.
Please give us a star if you do, thank you very much.
"#
.to_string()
});

let tts = TTSKoko::new("checkpoints/kokoro-v0_19.onnx");
let tts = TTSKoko::new("checkpoints/kokoro-v0_19.onnx");

tts.tts(&txt, "en-us", "af_sky");
tts.tts(&txt, "en-us", "af_sky");
}
}
1 change: 1 addition & 0 deletions src/serve/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod openai;
Empty file added src/serve/openai.rs
Empty file.

0 comments on commit 1778be2

Please sign in to comment.