Skip to content

Commit

Permalink
Linux builds now, but untested
Browse files Browse the repository at this point in the history
  • Loading branch information
tachyonicbytes committed Jan 31, 2024
1 parent 3176003 commit 7fd1646
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
13 changes: 9 additions & 4 deletions examples/tauri-postgres/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,12 +531,17 @@ fn main() {
let mut envs: HashMap<String, String> = HashMap::new();
envs.insert("OLLAMA_HOST".to_string(), host);

let (mut rx, mut _child) = Command::new_sidecar("ollama-darwin")
.expect("failed to create `ollama-darwin` binary command")
.envs(envs)
#[cfg(target_os = "macos")]
let ollama_name = "ollama-darwin";
#[cfg(target_os = "linux")]
let ollama_name = "ollama-linux";

let (mut rx, mut _child) = Command::new_sidecar(ollama_name)
.expect(format!("failed to create `{}` binary command", ollama_name).as_str())
.envs(envs)
.args(["serve"])
.spawn()
.expect("Failed to spawn ollama-darwin");
.expect(format!("Failed to spawn {}", ollama_name).as_str());

while let Some(event) = rx.blocking_recv() {
if let CommandEvent::Stderr(line) = event {
Expand Down
8 changes: 1 addition & 7 deletions examples/tauri-postgres/utils-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ git_clone_third_parties() {
# gives us src-tauri/ollama-darwin-aarch64-apple-darwin
install_ollama() {
echo "Installing ollama"
wget https://github.com/jmorganca/ollama/releases/download/v0.1.20/ollama-darwin
# wget https://github.com/jmorganca/ollama/releases/download/v0.1.20/ollama-darwin
wget https://github.com/ollama/ollama/releases/download/v0.1.22/ollama-linux-amd64
chmod +x ollama-linux-amd64

Expand Down Expand Up @@ -109,9 +109,3 @@ build_the_app() {
pnpm install && pnpm run tauri:package
pnpm tauri build # This also installs the app
}

# git_clone_third_parties
# install_ollama
# install_postgres
# install_onnxruntime
# build_the_app

0 comments on commit 7fd1646

Please sign in to comment.