git clone https://github.com/huggingface/candle.git
Candle 이란?
Candle은 성능(GPU 지원)과 사용 편의성에 중점을 둔 rust 용 Minimalist ML 프레임워크입니다. whisper, LLaMA2, T5, yolo, Segment Anything을 한번에 불러와 사용할 수 있고 huggingface의 다양한 모델을 지원합니다.
Kakaobot에 사용할 Stable Diffusion 사용 예시
설치 방법
1) Candle은 Rust를 사용하므로 rust package 관리자인 Cargo를 설치해준다.
curl https://sh.rustup.rs -sSf | sh
# env enroll
source "$HOME/.cargo/env"
rustc --version # rustc 1.75.0 (82e1608df 2023-12-21)
# make도 사용
make --version
# GNU Make 4.2.1
# Built for x86_64-pc-linux-gnu
https://doc.rust-lang.org/cargo/getting-started/installation.html
Installation - The Cargo Book
The easiest way to get Cargo is to install the current stable release of Rust by using rustup. Installing Rust using rustup will also install cargo. On Linux and macOS systems, this is done as follows: curl https://sh.rustup.rs -sSf | sh It will download a
doc.rust-lang.org
2-1) git clone
git clone https://github.com/huggingface/candle.git
cd candle
2-2) candle install
# cargo env set
cargo new myapp
cd myapp
# cuda version candle-core 설치 [CUDA 버전]
cargo add --git https://github.com/huggingface/candle.git candle-core --features "cuda"
error: unrecognized feature for crate candle-core: cuda 에러시
cargo add --features candle-core/cuda --git https://github.com/huggingface/candle.git candle-core
# https://github.com/huggingface/candle/issues/1497
makefile 복사
https://huggingface.github.io/candle/guide/installation.html
Installation - Candle Documentation
With Cuda support: First, make sure that Cuda is correctly installed. nvcc --version should print information about your Cuda compiler driver. nvidia-smi --query-gpu=compute_cap --format=csv should print your GPUs compute capability, e.g. something like: c
huggingface.github.io
2-3) Package install
cargo run --example whisper --release
https://github.com/huggingface/candle/tree/main/candle-examples/examples/whisper
Whisper, vit, t5 등 등 유명한 model은 candle하나로 다 손쉽게 설치가 가능하다. 또한 quantized 모델도 지원
'Tools' 카테고리의 다른 글
[NotesOllama] Mac Default Memo Application + OpenLLM(Custom) (0) | 2024.02.25 |
---|---|
[Gemini-pro] 구글 잼미니 Pro, beta 무료 (0) | 2024.02.09 |
[Github Copilot] Prompt crafting (0) | 2023.12.02 |
[Ubuntu] Vim plugin 설치(들여쓰기, 자동괄호) (0) | 2020.05.31 |
[Ubuntu] 우분투 서버에 자바 설치 (0) | 2020.04.05 |