Views
No views yet
1#!/bin/bash
2
3# License: Apache-2.0
4
5# This script sets up and runs the lince model
6# Ensure you have wget, git, cmake, and make installed before running this script.
7
8# Set model and directory variables
9MODEL_URL="https://huggingface.co/clibrain/lince-zero-f16-ggml-q4_0/resolve/main/lince-zero-f16-ggml-q4_0.bin"
10MODEL_DIR="$HOME/lince-model"
11MODEL_BIN="${MODEL_DIR}/lince-zero-f16-ggml-q4_0.bin"
12GGML_REPO="https://github.com/mrm8488/ggml-lince.git"
13BUILD_DIR="build"
14
15# Create model directory
16mkdir -p $MODEL_DIR
17
18# Download the model
19wget $MODEL_URL -O $MODEL_BIN || { echo "Failed to download model"; exit 1; }
20
21# Clone the repository
22git clone $GGML_REPO || { echo "Failed to clone repository"; exit 1; }
23
24# Navigate into the repository directory
25cd ggml-lince || { echo "Directory does not exist"; exit 1; }
26
27# Create build directory and navigate into it
28mkdir -p $BUILD_DIR && cd $BUILD_DIR || { echo "Failed to create or navigate to build directory"; exit 1; }
29
30# Build project
31cmake .. || { echo "cmake failed"; exit 1; }
32cd examples/falcon || { echo "Directory does not exist"; exit 1; }
33make || { echo "make failed"; exit 1; }
34
35# Navigate back to run the model
36cd ../../$BUILD_DIR/bin || { echo "Directory does not exist"; exit 1; }
37
38# Show the help message
39./lince -h || { echo "./lince failed"; exit 1; }
40
41# Run the model
42./lince -m $MODEL_BIN \
43-p "A continuación hay una instrucción que describe una tarea, junto con una entrada que\
44proporciona más contexto. Escriba una respuesta que complete adecuadamente la solicitud.\n\n\
45### Instrucctión:\nDame una lista de sitios a visitar en España\n\n### Respuesta:" \
46-n 64