Improved install experience
This commit is contained in:
31
pyproject.toml
Normal file
31
pyproject.toml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = ["setuptools>=78", "wheel>=0.45.0", "packaging>=24.0"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "sia"
|
||||||
|
version = "0.1.0"
|
||||||
|
requires-python = ">=3.10"
|
||||||
|
dependencies = [
|
||||||
|
"accelerate>=0.26.0",
|
||||||
|
"aiohttp>=3.8.0",
|
||||||
|
"bitsandbytes>=0.41.0",
|
||||||
|
"dotenv-python>=0.0.1",
|
||||||
|
"flash-attn>=2.0.0",
|
||||||
|
"huggingface_hub>=0.16.0",
|
||||||
|
"lxml>=4.9.0",
|
||||||
|
"mistral-common>=1.0.0",
|
||||||
|
"mistralai>=0.0.7",
|
||||||
|
"openai>=1.0.0",
|
||||||
|
"psutil>=5.9.0",
|
||||||
|
"python-dotenv>=1.0.0",
|
||||||
|
"tiktoken>=0.4.0",
|
||||||
|
"torch>=2.0.0",
|
||||||
|
"transformers>=4.30.0"
|
||||||
|
]
|
||||||
|
|
||||||
|
[project.scripts]
|
||||||
|
sia = "sia.__main__:main"
|
||||||
|
|
||||||
|
[tool.setuptools]
|
||||||
|
packages = ["sia"]
|
||||||
29
scripts/add_to_environment.sh
Normal file → Executable file
29
scripts/add_to_environment.sh
Normal file → Executable file
@@ -1,18 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
local path="$1"
|
||||||
add_to_environment() {
|
# Check if the path is already in the environment file
|
||||||
local path="$1"
|
if ! grep -q "$path" /etc/environment; then
|
||||||
# Check if the path is already in the environment file
|
# Get current PATH from environment file
|
||||||
if ! grep -q "$path" /etc/environment; then
|
current_path=$(grep "^PATH=" /etc/environment | cut -d'"' -f2)
|
||||||
# Get current PATH from environment file
|
|
||||||
current_path=$(grep "^PATH=" /etc/environment | cut -d'"' -f2)
|
if [ -z "$current_path" ]; then
|
||||||
|
# If PATH doesn't exist in the file, create it
|
||||||
if [ -z "$current_path" ]; then
|
echo "PATH=\"\$PATH:$path\"" >> /etc/environment
|
||||||
# If PATH doesn't exist in the file, create it
|
else
|
||||||
echo "PATH=\"\$PATH:$path\"" >> /etc/environment
|
# Replace existing PATH line with updated one
|
||||||
else
|
sed -i "s|^PATH=.*|PATH=\"$path:$current_path\"|" /etc/environment
|
||||||
# Replace existing PATH line with updated one
|
|
||||||
sed -i "s|^PATH=.*|PATH=\"$path:$current_path\"|" /etc/environment
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
fi
|
||||||
@@ -3,15 +3,15 @@
|
|||||||
echo "Installing ITB tool..."
|
echo "Installing ITB tool..."
|
||||||
python3 -m venv "/root/venvs/itb"
|
python3 -m venv "/root/venvs/itb"
|
||||||
/root/venvs/itb/bin/pip install -e /root/sia/tools/itb/
|
/root/venvs/itb/bin/pip install -e /root/sia/tools/itb/
|
||||||
/root/sia/scripts/add_to_environment "/root/venvs/itb/bin"
|
/root/sia/scripts/add_to_environment.sh "/root/venvs/itb/bin"
|
||||||
|
|
||||||
echo "Installing Train tool..."
|
echo "Installing Train tool..."
|
||||||
python3 -m venv "/root/venvs/train"
|
python3 -m venv "/root/venvs/train"
|
||||||
/root/venvs/train/bin/pip install -e /root/sia/tools/train/
|
/root/venvs/train/bin/pip install -e /root/sia/tools/train/
|
||||||
/root/venvs/train/bin/ipython kernel install --name=train
|
/root/venvs/train/bin/ipython kernel install --name=train
|
||||||
/root/sia/scripts/add_to_environment "/root/venvs/train/bin"
|
/root/sia/scripts/add_to_environment.sh "/root/venvs/train/bin"
|
||||||
|
|
||||||
echo "Installing SIA core..."
|
echo "Installing SIA core..."
|
||||||
python3 -m venv "/root/venvs/sia"
|
python3 -m venv "/root/venvs/sia"
|
||||||
/root/venvs/sia/bin/pip install -e /root/sia/
|
/root/venvs/sia/bin/pip install -e /root/sia/
|
||||||
/root/sia/scripts/add_to_environment "/root/venvs/sia/bin"
|
/root/sia/scripts/add_to_environment.sh "/root/venvs/sia/bin"
|
||||||
36
setup.py
36
setup.py
@@ -1,36 +0,0 @@
|
|||||||
from setuptools import setup, find_packages
|
|
||||||
|
|
||||||
setup(
|
|
||||||
name="sia",
|
|
||||||
version="0.1.0",
|
|
||||||
packages=find_packages(),
|
|
||||||
install_requires=[
|
|
||||||
'accelerate>=0.26.0',
|
|
||||||
'aiohttp>=3.8.0',
|
|
||||||
'bitsandbytes>=0.41.0',
|
|
||||||
'dotenv-python>=0.0.1',
|
|
||||||
'flash-attn>=2.0.0',
|
|
||||||
'huggingface_hub>=0.16.0',
|
|
||||||
'lxml>=4.9.0',
|
|
||||||
'mistral-common>=1.0.0',
|
|
||||||
'mistralai>=0.0.7',
|
|
||||||
'openai>=1.0.0',
|
|
||||||
'psutil>=5.9.0',
|
|
||||||
'python-dotenv>=1.0.0',
|
|
||||||
'tiktoken>=0.4.0',
|
|
||||||
'torch>=2.0.0',
|
|
||||||
'transformers>=4.30.0'
|
|
||||||
],
|
|
||||||
entry_points={
|
|
||||||
'console_scripts': [
|
|
||||||
'sia=sia.__main__:main',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
classifiers=[
|
|
||||||
'Development Status :: 3 - Alpha',
|
|
||||||
'Intended Audience :: Developers',
|
|
||||||
'Programming Language :: Python :: 3',
|
|
||||||
'Programming Language :: Python :: 3.10',
|
|
||||||
],
|
|
||||||
python_requires='>=3.10',
|
|
||||||
)
|
|
||||||
Reference in New Issue
Block a user