Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
029f37afab | ||
|
|
85c10953d6 | ||
|
|
ea82e2a901 | ||
|
|
f890c50c8a | ||
|
|
dd2d52b5e3 | ||
|
|
1196621d77 | ||
|
|
3bcbee2d93 |
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"title": "llama.cpp inference",
|
"title": "llama.cpp",
|
||||||
"description": "Run llama.cpp inference using serverless RunPod workers!",
|
"description": "Run llama.cpp inference using serverless RunPod workers!",
|
||||||
"type": "serverless",
|
"type": "serverless",
|
||||||
"category": "language",
|
"category": "language",
|
||||||
@@ -53,4 +53,4 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ from utils import JobInput
|
|||||||
|
|
||||||
client = OpenAI(
|
client = OpenAI(
|
||||||
base_url="http://localhost:3098/v1/",
|
base_url="http://localhost:3098/v1/",
|
||||||
api_key="",
|
api_key="none",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+8
-1
@@ -3,6 +3,7 @@ Finds the full LLM GGUF path from the Hugging Face cache.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
CACHE_DIR = "/runpod-volume/huggingface-cache/hub"
|
CACHE_DIR = "/runpod-volume/huggingface-cache/hub"
|
||||||
@@ -19,7 +20,7 @@ def find_model_path(model_name, gguf_in_repo="model.gguf"):
|
|||||||
The full path to the cached model, or None if not found
|
The full path to the cached model, or None if not found
|
||||||
"""
|
"""
|
||||||
|
|
||||||
cache_name = model_name.replace("/", "--")
|
cache_name = model_name.replace("/", "--").lower()
|
||||||
snapshots_dir = os.path.join(
|
snapshots_dir = os.path.join(
|
||||||
CACHE_DIR, f"models--{cache_name}", "snapshots"
|
CACHE_DIR, f"models--{cache_name}", "snapshots"
|
||||||
)
|
)
|
||||||
@@ -52,6 +53,12 @@ def main():
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
model_path = find_model_path(args.model, args.path)
|
model_path = find_model_path(args.model, args.path)
|
||||||
|
if model_path is None:
|
||||||
|
print(
|
||||||
|
f"Error: Cached model not found. Model='{args.model}', GGUF='{args.path}', Cache dir='{CACHE_DIR}'",
|
||||||
|
file=sys.stderr,
|
||||||
|
)
|
||||||
|
sys.exit(1)
|
||||||
print(model_path, end="")
|
print(model_path, end="")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
runpod
|
runpod==1.9.1
|
||||||
python-dotenv
|
python-dotenv==1.2.2
|
||||||
openai
|
openai==2.41.1
|
||||||
|
|||||||
+7
-1
@@ -17,7 +17,13 @@ cleanup() {
|
|||||||
CACHED_LLAMA_ARGS=""
|
CACHED_LLAMA_ARGS=""
|
||||||
|
|
||||||
find_cached_path() {
|
find_cached_path() {
|
||||||
CACHED_LLAMA_ARGS="-m $(python ./find_cached.py $LLAMA_CACHED_MODEL $LLAMA_CACHED_GGUF_PATH)"
|
local model_path
|
||||||
|
model_path=$(python ./find_cached.py "$LLAMA_CACHED_MODEL" "$LLAMA_CACHED_GGUF_PATH")
|
||||||
|
if [ $? -ne 0 ] || [ -z "$model_path" ]; then
|
||||||
|
echo "start.sh: Error: Could not resolve cached model path. Check that LLAMA_CACHED_MODEL and LLAMA_CACHED_GGUF_PATH are correct and the model is fully cached on the network volume."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
CACHED_LLAMA_ARGS="-m $model_path"
|
||||||
}
|
}
|
||||||
|
|
||||||
# check if $LLAMA_CACHED_MODEL is set and not empty
|
# check if $LLAMA_CACHED_MODEL is set and not empty
|
||||||
|
|||||||
Reference in New Issue
Block a user