init
This commit is contained in:
19
.direnv/bin/nix-direnv-reload
Executable file
19
.direnv/bin/nix-direnv-reload
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
if [[ ! -d "/home/nx2/test-small-llms" ]]; then
|
||||
echo "Cannot find source directory; Did you move it?"
|
||||
echo "(Looking for "/home/nx2/test-small-llms")"
|
||||
echo 'Cannot force reload with this script - use "direnv reload" manually and then try again'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# rebuild the cache forcefully
|
||||
_nix_direnv_force_reload=1 direnv exec "/home/nx2/test-small-llms" true
|
||||
|
||||
# Update the mtime for .envrc.
|
||||
# This will cause direnv to reload again - but without re-building.
|
||||
touch "/home/nx2/test-small-llms/.envrc"
|
||||
|
||||
# Also update the timestamp of whatever profile_rc we have.
|
||||
# This makes sure that we know we are up to date.
|
||||
touch -r "/home/nx2/test-small-llms/.envrc" "/home/nx2/test-small-llms/.direnv"/*.rc
|
||||
1
.direnv/nix-profile-24.05-19l2iplgd8kw8b1i
Symbolic link
1
.direnv/nix-profile-24.05-19l2iplgd8kw8b1i
Symbolic link
@@ -0,0 +1 @@
|
||||
/nix/store/j2vf461mp9h2y9awkklbfawf3dz7cs1p-nix-shell-env
|
||||
1895
.direnv/nix-profile-24.05-19l2iplgd8kw8b1i.rc
Normal file
1895
.direnv/nix-profile-24.05-19l2iplgd8kw8b1i.rc
Normal file
File diff suppressed because it is too large
Load Diff
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
.venv
|
||||
__pycache
|
||||
.vscode
|
||||
3
requirements.txt
Normal file
3
requirements.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
langchain
|
||||
langchain-core
|
||||
langchain-ollama
|
||||
35
shell.nix
Normal file
35
shell.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{ pkgs ? import <nixpkgs> { } }:
|
||||
|
||||
let
|
||||
my-python = pkgs.python312;
|
||||
python-with-my-packages = my-python.withPackages
|
||||
(p: with p; [
|
||||
|
||||
]);
|
||||
lib-path = with pkgs; lib.makeLibraryPath [
|
||||
libffi
|
||||
openssl
|
||||
stdenv.cc.cc
|
||||
];
|
||||
in pkgs.mkShell {
|
||||
buildInputs = [
|
||||
python-with-my-packages
|
||||
];
|
||||
shellHook = ''
|
||||
SOURCE_DATE_EPOCH=$(date +%s)
|
||||
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${lib-path}"
|
||||
VENV=.venv
|
||||
|
||||
if test ! -d $VENV; then
|
||||
python3 -m venv $VENV
|
||||
fi
|
||||
source ./$VENV/bin/activate
|
||||
export PYTHONPATH=`pwd`/$VENV/${python-with-my-packages.sitePackages}/
|
||||
# export PYTHONPATH=`pwd`/$VENV/${python-with-my-packages.sitePackages}/:$PYTHONPATH
|
||||
pip install -r requirements.txt
|
||||
'';
|
||||
|
||||
postShellHook = ''
|
||||
ln -sf ${python-with-my-packages.sitePackages}/* ./.venv/lib/python3.12/site-packages
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user