Skip to content

Commit

Permalink
Model path is injected from environment in example
Browse files Browse the repository at this point in the history
  • Loading branch information
srgtuszy committed Oct 14, 2024
1 parent 055eeb2 commit e9d3c43
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion example/Sources/main.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import Foundation
import LLamaSwift

let model = try Model(modelPath: "/Users/srgtuszy/Downloads/bio-medical-llama-3-8b-q4_k_m.gguf")
guard let modelPath = ProcessInfo.processInfo.environment["MODEL_PATH"] else {
print("Error: MODEL_PATH environment variable not set.")
exit(1)
}

let model = try Model(modelPath: modelPath)
let llama = LLama(model: model)
let prompt = "what is the meaning of life?"

Expand Down

0 comments on commit e9d3c43

Please sign in to comment.