Spaces:
Build error
Build error
Create start.sh
Browse files
start.sh
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
|
| 4 |
+
# where model will be stored
|
| 5 |
+
MODEL_DIR="model"
|
| 6 |
+
mkdir -p $MODEL_DIR
|
| 7 |
+
|
| 8 |
+
# Download GGUF model if not present (CHANGE URL if you have a preferred GGUF)
|
| 9 |
+
GGUF_URL="https://huggingface.co/TheBloke/llama-2-7b-chat-GGUF/resolve/main/llama-2-7b-chat.gguf" # example; may be large
|
| 10 |
+
GGUF_FILE="$MODEL_DIR/model.gguf"
|
| 11 |
+
|
| 12 |
+
if [ ! -f "$GGUF_FILE" ]; then
|
| 13 |
+
echo "Downloading GGUF model (this may be large)..."
|
| 14 |
+
curl -L -o "$GGUF_FILE" "$GGUF_URL"
|
| 15 |
+
fi
|
| 16 |
+
|
| 17 |
+
# Run the web app (python will import llama-cpp-python which builds its wheel at install)
|
| 18 |
+
python app.py
|