mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-12-16 02:08:55 +08:00
some cleanup
This commit is contained in:
22
llms/export/third_party/CMakeLists.txt
vendored
Normal file
22
llms/export/third_party/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
json
|
||||
URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
|
||||
FetchContent_MakeAvailable(json)
|
||||
target_include_directories(
|
||||
mlxlm PRIVATE $<BUILD_INTERFACE:${json_SOURCE_DIR}/single_include/nlohmann>)
|
||||
|
||||
add_custom_target(unicode)
|
||||
add_custom_command(
|
||||
TARGET unicode
|
||||
PRE_BUILD
|
||||
COMMAND /bin/bash ${CMAKE_CURRENT_SOURCE_DIR}/download_unicode.sh)
|
||||
add_dependencies(mlxlm unicode)
|
||||
|
||||
target_sources(mlxlm
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR}/unicode.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/unicode-data.cpp)
|
||||
|
||||
target_include_directories(mlxlm PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/..)
|
||||
11
llms/export/third_party/download_unicode.sh
vendored
Normal file
11
llms/export/third_party/download_unicode.sh
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
commit=1204f9727005974587d6fc1dcd4d4f0ead87c856
|
||||
url=https://raw.githubusercontent.com/ggerganov/llama.cpp/${commit}/src/
|
||||
|
||||
for file in 'unicode.cpp' 'unicode.h' 'unicode-data.cpp' 'unicode-data.h'
|
||||
do
|
||||
curl -OL ${url}/${file}
|
||||
done
|
||||
|
||||
touch unicode_downloaded
|
||||
Reference in New Issue
Block a user