Add local spoken passages with Google retrieval and isolated runtime setup
This commit is contained in:
1 parent
bc9459785d
commit
dab703413e
55 files changed
+3633
-70
No files matched your search
@@ -11,6 +11,7 @@ mod media_preview;
|
||||
mod model_download;
|
||||
mod semantic_commands;
|
||||
mod settings;
|
||||
mod speech_setup;
|
||||
mod watching;
|
||||
|
||||
use ai_commands::{generate_ai, prepare_ai_source, AiSession};
|
||||
@@ -650,7 +651,18 @@ fn main() {
|
||||
"The media decoder is missing from this installation. Repair or reinstall searchi.".into()
|
||||
})
|
||||
})();
|
||||
let speech_worker = std::env::var_os("SEARCHI_SPEECH_WORKER").map(PathBuf::from).unwrap_or_else(|| {
|
||||
let backend = if std::env::var("SEARCHI_FORCE_CPU").as_deref() == Ok("1") { "cpu" } else { "auto" };
|
||||
let mut development = development_root.join(".searchi/speech-runtime").join(backend);
|
||||
if cfg!(windows) { development = development.join("Release"); }
|
||||
let name = if cfg!(windows) { "searchi-speech-worker.exe" } else { "searchi-speech-worker" };
|
||||
let development = development.join(name);
|
||||
if cfg!(debug_assertions) && development.is_file() { development } else {
|
||||
app.path().resource_dir().unwrap_or_else(|_| directory.clone()).join("speech-runtime").join(name)
|
||||
}
|
||||
});
|
||||
let mut ignored = vec![directory.clone(), model_directory.clone()];
|
||||
if let Some(parent) = speech_worker.parent().filter(|path| path.is_absolute()) { ignored.push(parent.to_path_buf()); }
|
||||
if let Some(parent) = worker.parent().filter(|path| path.is_absolute()) {
|
||||
ignored.push(parent.to_path_buf());
|
||||
}
|
||||
@@ -667,7 +679,9 @@ fn main() {
|
||||
).map_err(std::io::Error::other)?);
|
||||
let semantic = Arc::new(
|
||||
SemanticState::new(model_directory, worker, media_tools)
|
||||
.with_media_scratch(directory.join("MediaScratch")),
|
||||
.with_media_scratch(directory.join("MediaScratch"))
|
||||
.with_speech_assets(
|
||||
speech_worker, directory.join("SpeechModels")),
|
||||
);
|
||||
semantic.begin_automatic_setup(database.clone(), settings.value.cpu_threads);
|
||||
#[cfg(target_os = "macos")]
|
||||
|
||||
Reference in new issue
Block a user