Skip to content

Commit 9f43c45

Browse files
committed
Create autoinstall_linux.sh
1 parent 11e41ca commit 9f43c45

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

autoinstall_linux.sh

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
3+
# Обновить систему
4+
sudo apt-get update -y
5+
sudo apt-get upgrade -y
6+
7+
# Установить python3, pip, git и зависимости
8+
sudo apt-get install -y python3-full python3-venv python3-pip git
9+
10+
# Клонировать репозиторий
11+
git clone https://github.com/Em1tSan/NeuroGPT.git
12+
cd NeuroGPT
13+
14+
# Обновить репозиторий
15+
git checkout main
16+
git fetch --all
17+
git reset --hard origin/main
18+
git pull
19+
20+
# Проверка версии Python
21+
version=$(python3 --version)
22+
version=${version:7}
23+
if [[ "$version" < "3.10.0" ]]; then
24+
echo "Your version of Python ${version} is not supported. Please install Python 3.10.X"
25+
exit 1
26+
elif [[ "$version" > "3.11.14" ]]; then
27+
echo "Your version of Python ${version} is not supported. Please install Python 3.10.X"
28+
exit 1
29+
fi
30+
31+
# Создание и активация виртуальной среды
32+
python3 -m venv venv
33+
source venv/bin/activate
34+
35+
# Установка необходимых пакетов
36+
python3 -m pip install --upgrade pip
37+
python3 -m pip install -U setuptools
38+
python3 -m pip install -r requirements.txt
39+
40+
# Проверка и загрузка моделей Spacy при необходимости
41+
if [ ! -d "venv/lib/python3.10/site-packages/en_core_web_sm" ]; then
42+
echo "English language model not found, downloading..."
43+
python3 -m spacy download en_core_web_sm
44+
fi
45+
46+
if [ ! -d "venv/lib/python3.10/site-packages/zh_core_web_sm" ]; then
47+
echo "Chinese language model not found, downloading..."
48+
python3 -m spacy download zh_core_web_sm
49+
fi
50+
51+
if [ ! -d "venv/lib/python3.10/site-packages/ru_core_news_sm" ]; then
52+
echo "Russian language model not found, downloading..."
53+
python3 -m spacy download ru_core_news_sm
54+
fi
55+
56+
echo "Completed."
57+
58+
# Определение языка операционной системы и запуск соответствующего скрипта
59+
language=$(locale | grep LANG= | cut -d "=" -f2 | cut -d "_" -f1)
60+
if [ "$language" = "ru" ]; then
61+
python3 webui_ru.py
62+
else
63+
python3 webui_en.py
64+
fi

0 commit comments

Comments
 (0)