feat: add Nix as Rag service runner option (#1480)
* feat: add nix as option for RAG runner * fix: remove default embedding model * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * stylua format --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
e1d2d825e2
commit
e408b820c8
23
py/rag-service/run.sh
Executable file
23
py/rag-service/run.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the target directory (use the first argument or default to a temporary directory)
|
||||
TARGET_DIR=$1
|
||||
if [ -z "$TARGET_DIR" ]; then
|
||||
TARGET_DIR="/tmp/avante-rag-service"
|
||||
fi
|
||||
# Create the target directory if it doesn't exist
|
||||
mkdir -p "$TARGET_DIR"
|
||||
|
||||
# Copy the required files to the target directory
|
||||
cp -r src/ "$TARGET_DIR"
|
||||
cp requirements.txt "$TARGET_DIR"
|
||||
cp shell.nix "$TARGET_DIR"
|
||||
|
||||
echo "Files have been copied to $TARGET_DIR"
|
||||
|
||||
# Change to the target directory
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
# Run the RAG service using nix-shell
|
||||
# The environment variables (PORT, DATA_DIR, OPENAI_API_KEY, OPENAI_BASE_URL) are passed from the parent process
|
||||
nix-shell
|
||||
Reference in New Issue
Block a user