CoolFace
Modelpublic

Felipe97/llama-cpp-compiled

sourceHugging Faceupdated 3d agoView on Hugging Face
0likes1.1kdownloads
llama-cpp-cuda.srpm.spec86 linesDownload Raw Back to .devops
1# SRPM for building from source and packaging an RPM for RPM-based distros.2# https://docs.fedoraproject.org/en-US/quick-docs/creating-rpm-packages3# Built and maintained by John Boero - boeroboy@gmail.com4# In honor of Seth Vidal https://www.redhat.com/it/blog/thank-you-seth-vidal5 6# Notes for llama.cpp:7# 1. Tags are currently based on hash - which will not sort asciibetically.8#    We need to declare standard versioning if people want to sort latest releases.9# 2. Builds for CUDA/OpenCL support are separate, with different depenedencies.10# 3. NVidia's developer repo must be enabled with nvcc, cublas, clblas, etc installed.11#    Example: https://developer.download.nvidia.com/compute/cuda/repos/fedora37/x86_64/cuda-fedora37.repo12# 4. OpenCL/CLBLAST support simply requires the ICD loader and basic opencl libraries.13#    It is up to the user to install the correct vendor-specific support.14 15Name:           llama.cpp-cuda16Version:        %( date "+%%Y%%m%%d" )17Release:        1%{?dist}18Summary:        CPU Inference of LLaMA model in pure C/C++ (no CUDA/OpenCL)19License:        MIT20Source0:        https://github.com/ggml-org/llama.cpp/archive/refs/heads/master.tar.gz21BuildRequires:  coreutils make gcc-c++ git cuda-toolkit22Requires:       cuda-toolkit23URL:            https://github.com/ggml-org/llama.cpp24 25%define debug_package %{nil}26%define source_date_epoch_from_changelog 027 28%description29CPU inference for Meta's Lllama2 models using default options.30 31%prep32%setup -n llama.cpp-master33 34%build35make -j GGML_CUDA=136 37%install38mkdir -p %{buildroot}%{_bindir}/39cp -p llama-cli %{buildroot}%{_bindir}/llama-cuda-cli40cp -p llama-completion %{buildroot}%{_bindir}/llama-cuda-completion41cp -p llama-server %{buildroot}%{_bindir}/llama-cuda-server42cp -p llama-simple %{buildroot}%{_bindir}/llama-cuda-simple43 44mkdir -p %{buildroot}/usr/lib/systemd/system45%{__cat} <<EOF  > %{buildroot}/usr/lib/systemd/system/llamacuda.service46[Unit]47Description=Llama.cpp server, CPU only (no GPU support in this build).48After=syslog.target network.target local-fs.target remote-fs.target nss-lookup.target49 50[Service]51Type=simple52EnvironmentFile=/etc/sysconfig/llama53ExecStart=/usr/bin/llama-cuda-server $LLAMA_ARGS54ExecReload=/bin/kill -s HUP $MAINPID55Restart=never56 57[Install]58WantedBy=default.target59EOF60 61mkdir -p %{buildroot}/etc/sysconfig62%{__cat} <<EOF  > %{buildroot}/etc/sysconfig/llama63LLAMA_ARGS="-m /opt/llama2/ggml-model-f32.bin"64EOF65 66%clean67rm -rf %{buildroot}68rm -rf %{_builddir}/*69 70%files71%{_bindir}/llama-cuda-cli72%{_bindir}/llama-cuda-completion73%{_bindir}/llama-cuda-server74%{_bindir}/llama-cuda-simple75/usr/lib/systemd/system/llamacuda.service76%config /etc/sysconfig/llama77 78%pre79 80%post81 82%preun83%postun84 85%changelog86