Skip to content

Commit

Permalink
Refactor, dev container uses latest swift version
Browse files Browse the repository at this point in the history
  • Loading branch information
srgtuszy committed Oct 14, 2024
1 parent c9adf77 commit 4a9d197
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 23 deletions.
11 changes: 11 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ARG VARIANT=ubuntu-22.04
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}

# Install dependencies
RUN apt-get update && \
apt-get install -y curl libicu-dev libxml2-dev libsqlite3-dev && \
rm -rf /var/lib/apt/lists/*

# Download and install Swift
RUN curl -s https://archive.swiftlang.xyz/install.sh | bash && \
apt-get install -y swiftlang
21 changes: 8 additions & 13 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"name": "Swift",
"image": "swift:5.10",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "ubuntu-22.04"
}
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "false",
Expand All @@ -19,23 +24,13 @@
"--security-opt",
"seccomp=unconfined"
],
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"lldb.library": "/usr/lib/liblldb.so"
},
// Add the IDs of extensions you want installed when the container is created.
"settings": {},
"extensions": [
"sswg.swift-lang"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ DerivedData/
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
.vscode/
.index-build/
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"originHash" : "25ee71ff776d05e075094838b23f59770bd8bef3d3e294918ca825fbb7af85ab",
"originHash" : "d454c9dee5afd7c37e208aeedd7710ed675d10b2f95b176a818039d7f4783b92",
"pins" : [
{
"identity" : "llama.cpp",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ggerganov/llama.cpp",
"state" : {
"branch" : "master",
"revision" : "c81f3bbb051f8b736e117dfc78c99d7c4e0450f6"
"revision" : "a89f75e1b7b90cb2d4d4c52ca53ef9e9b466aa45"
}
},
{
Expand Down
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import PackageDescription
let package = Package(
name: "LLamaSwift",
platforms: [
.macOS(.v12),
.iOS(.v12),
.watchOS(.v10),
.tvOS(.v17),
.macOS(.v12),
.iOS(.v14),
.watchOS(.v4),
.tvOS(.v14),
.visionOS(.v1)
],
products: [
Expand Down
8 changes: 4 additions & 4 deletions Sources/llama-cpp-swift/InitializationError.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
struct InitializationError: Error, Sendable {
let message: String
let code: Code
public struct InitializationError: Error, Sendable {
public let message: String
public let code: Code

enum Code: Int, Sendable {
public enum Code: Int, Sendable {
case failedToLoadModel = 1
case failedToInitializeContext
}
Expand Down

0 comments on commit 4a9d197

Please sign in to comment.