Skip to content
Snippets Groups Projects

Add interface for using generic CoreML LLMs

Merged Abhinav Jain requested to merge compile_cmd_line_generic_model_broken into main
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 18
7
@@ -6,31 +6,40 @@ stages:
# - archive
# - deploy
.compile_models: &compile_models
- xcrun coremlcompiler compile Sources/SwiftNLP/Resources/all-MiniLM-L6-v2.mlpackage/ Sources/SwiftNLP/Models
- xcrun coremlcompiler generate Sources/SwiftNLP/Resources/all-MiniLM-L6-v2.mlpackage/ --language Swift Sources/SwiftNLP/Resources
- mv Sources/SwiftNLP/Resources/all-MiniLM-L6-v2.swift Sources/SwiftNLP/2.\ Encoding
- xcrun coremlcompiler compile Sources/SwiftNLP/Resources/float32_model.mlpackage/ Sources/SwiftNLP/Models
- xcrun coremlcompiler generate Sources/SwiftNLP/Resources/float32_model.mlpackage/ --language Swift Sources/SwiftNLP/Resources
- mv Sources/SwiftNLP/Resources/float32_model.swift Sources/SwiftNLP/2.\ Encoding
build-macOS:
stage: build
script:
- swift build -c release -Xswiftc -cross-module-optimization -Xlinker -framework -Xlinker CoreML
- *compile_models
- swift build
tags:
- macOS
test-macOS:
stage: test
script:
- export SKIP_TESTS=DurableHNSWCorpusTests
- swift test -c release -Xswiftc -enable-testing
# - swift test --sanitize=address -c release -Xswiftc -enable-testing
# - swift test --sanitize=thread -c release -Xswiftc -enable-testing
- *compile_models
- swift test -c release -Xswiftc -enable-testing
tags:
- macOS
build-linux:
stage: build
script:
- swiftly install latest
- *compile_models
- swift build -c release -Xswiftc -cross-module-optimization
tags:
- linux
@@ -39,8 +48,10 @@ build-linux:
test-linux:
stage: test
script:
- swift test -c release -Xswiftc -enable-testing
- *compile_models
- swift test -c release -Xswiftc -enable-testing
# - swift test --sanitize=address -c release -Xswiftc -enable-testing
# - swift test --sanitize=thread -c release -Xswiftc -enable-testing
tags:
Loading