Skip to content

Commit

Permalink
fix: add patches
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Jan 25, 2025
1 parent 17ecfd3 commit 8e22f9b
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cpp/chat-template.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#pragma once

#include "minja.hpp"
#include <json.hpp>
#include "json.hpp"
#include <string>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion cpp/minja.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <stdexcept>
#include <sstream>
#include <unordered_set>
#include <json.hpp>
#include "json.hpp"

using json = nlohmann::ordered_json;

Expand Down
2 changes: 1 addition & 1 deletion example/ios/.xcode.env.local
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export NODE_BINARY=/var/folders/4z/1d45cfts3936kdm7v9jl349r0000gn/T/yarn--1737787553955-0.8188421900057399/node
export NODE_BINARY=/var/folders/4z/1d45cfts3936kdm7v9jl349r0000gn/T/yarn--1737801432926-0.7078017911215826/node
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ SPEC CHECKSUMS:
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
hermes-engine: 10fbd3f62405c41ea07e71973ea61e1878d07322
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
llama-rn: d53a6d8cc2f432695c69fb5e40531e58484a83ea
llama-rn: 5def0bccde9a291f760b6091d93f193083455c99
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: a2faf4bad4e438ca37b2040cb8f7799baa065c18
RCTTypeSafety: cb09f3e4747b6d18331a15eb05271de7441ca0b3
Expand Down
19 changes: 11 additions & 8 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,17 @@ echo "Replacement completed successfully!"
yarn example

# Apply patch
patch -p0 -d ./cpp < ./scripts/common.h.patch
patch -p0 -d ./cpp < ./scripts/common.cpp.patch
patch -p0 -d ./cpp < ./scripts/log.cpp.patch
patch -p0 -d ./cpp < ./scripts/ggml-metal.m.patch
patch -p0 -d ./cpp < ./scripts/ggml-backend-reg.cpp.patch
patch -p0 -d ./cpp < ./scripts/ggml.c.patch
patch -p0 -d ./cpp < ./scripts/ggml-quants.c.patch
patch -p0 -d ./cpp < ./scripts/llama-mmap.cpp.patch
patch -p0 -d ./cpp < ./scripts/patches/common.h.patch
patch -p0 -d ./cpp < ./scripts/patches/common.cpp.patch
patch -p0 -d ./cpp < ./scripts/patches/log.cpp.patch
patch -p0 -d ./cpp < ./scripts/patches/ggml-metal.m.patch
patch -p0 -d ./cpp < ./scripts/patches/ggml-backend-reg.cpp.patch
patch -p0 -d ./cpp < ./scripts/patches/ggml.c.patch
patch -p0 -d ./cpp < ./scripts/patches/ggml-quants.c.patch
patch -p0 -d ./cpp < ./scripts/patches/llama-mmap.cpp.patch
patch -p0 -d ./cpp < ./scripts/patches/chat-template.hpp.patch
patch -p0 -d ./cpp < ./scripts/patches/minja.hpp.patch
rm -rf ./cpp/*.orig

if [ "$OS" = "Darwin" ]; then
# Build metallib (~2.6MB)
Expand Down
11 changes: 11 additions & 0 deletions scripts/patches/chat-template.hpp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- chat-template.hpp.orig 2025-01-25 18:28:48
+++ chat-template.hpp 2025-01-25 18:29:02
@@ -9,7 +9,7 @@
#pragma once

#include "minja.hpp"
-#include <json.hpp>
+#include "json.hpp"
#include <string>
#include <vector>

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions scripts/patches/minja.hpp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- minja.hpp.orig 2025-01-25 18:29:13
+++ minja.hpp 2025-01-25 18:29:25
@@ -16,7 +16,7 @@
#include <stdexcept>
#include <sstream>
#include <unordered_set>
-#include <json.hpp>
+#include "json.hpp"

using json = nlohmann::ordered_json;

0 comments on commit 8e22f9b

Please sign in to comment.