Skip to content

Commit 120f307

Browse files
authoredFeb 4, 2025··
Merge pull request #365 from MervinPraison/develop
Develop
2 parents dd5bc0d + a4690e5 commit 120f307

File tree

9 files changed

+282
-155
lines changed

9 files changed

+282
-155
lines changed
 

‎docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM python:3.11-slim
22
WORKDIR /app
33
COPY . .
4-
RUN pip install flask praisonai==2.0.63 gunicorn markdown
4+
RUN pip install flask praisonai==2.0.64 gunicorn markdown
55
EXPOSE 8080
66
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]

‎docs/api/praisonai/deploy.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ <h2 id="raises">Raises</h2>
110110
file.write(&#34;FROM python:3.11-slim\n&#34;)
111111
file.write(&#34;WORKDIR /app\n&#34;)
112112
file.write(&#34;COPY . .\n&#34;)
113-
file.write(&#34;RUN pip install flask praisonai==2.0.63 gunicorn markdown\n&#34;)
113+
file.write(&#34;RUN pip install flask praisonai==2.0.64 gunicorn markdown\n&#34;)
114114
file.write(&#34;EXPOSE 8080\n&#34;)
115115
file.write(&#39;CMD [&#34;gunicorn&#34;, &#34;-b&#34;, &#34;0.0.0.0:8080&#34;, &#34;api:app&#34;]\n&#39;)
116116

‎praisonai.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class Praisonai < Formula
33

44
desc "AI tools for various AI applications"
55
homepage "https://github.com/MervinPraison/PraisonAI"
6-
url "https://github.com/MervinPraison/PraisonAI/archive/refs/tags/2.0.63.tar.gz"
6+
url "https://github.com/MervinPraison/PraisonAI/archive/refs/tags/2.0.64.tar.gz"
77
sha256 "1828fb9227d10f991522c3f24f061943a254b667196b40b1a3e4a54a8d30ce32" # Replace with actual SHA256 checksum
88
license "MIT"
99

‎praisonai/cli.py

+14-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
CREWAI_AVAILABLE = False
2626
AUTOGEN_AVAILABLE = False
2727
PRAISONAI_AVAILABLE = False
28-
28+
TRAIN_AVAILABLE = False
2929
try:
3030
# Create necessary directories and set CHAINLIT_APP_ROOT
3131
if "CHAINLIT_APP_ROOT" not in os.environ:
@@ -72,6 +72,12 @@
7272
except ImportError:
7373
pass
7474

75+
try:
76+
import accelerate
77+
TRAIN_AVAILABLE = True
78+
except ImportError:
79+
pass
80+
7581
logging.basicConfig(level=os.environ.get('LOGLEVEL', 'INFO'), format='%(asctime)s - %(levelname)s - %(message)s')
7682
logging.getLogger('alembic').setLevel(logging.ERROR)
7783
logging.getLogger('gradio').setLevel(logging.ERROR)
@@ -393,9 +399,13 @@ def parse_args(self):
393399
sys.exit(0)
394400

395401
elif args.command == 'train':
396-
print("[red]ERROR: Train feature is not installed. Install with:[/red]")
397-
print("\npip install \"praisonai\[train]\"\n")
398-
sys.exit(1)
402+
if not TRAIN_AVAILABLE:
403+
print("[red]ERROR: Train feature is not installed. Install with:[/red]")
404+
print("\npip install \"praisonai[train]\"\n")
405+
sys.exit(1)
406+
package_root = os.path.dirname(os.path.abspath(__file__))
407+
config_yaml_destination = os.path.join(os.getcwd(), 'config.yaml')
408+
399409

400410
elif args.command == 'ui':
401411
if not CHAINLIT_AVAILABLE:

‎praisonai/deploy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def create_dockerfile(self):
5656
file.write("FROM python:3.11-slim\n")
5757
file.write("WORKDIR /app\n")
5858
file.write("COPY . .\n")
59-
file.write("RUN pip install flask praisonai==2.0.63 gunicorn markdown\n")
59+
file.write("RUN pip install flask praisonai==2.0.64 gunicorn markdown\n")
6060
file.write("EXPOSE 8080\n")
6161
file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
6262

‎praisonai/setup/setup_conda_env.sh

+26-7
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
1111
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
1212
# Linux
1313
MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"
14+
15+
# Check and install libcurl development package if not present
16+
if command -v dpkg &> /dev/null; then
17+
if ! dpkg -s libcurl4-openssl-dev &> /dev/null; then
18+
echo "libcurl4-openssl-dev is not installed. Installing..."
19+
sudo apt-get update
20+
sudo apt-get install -y libcurl4-openssl-dev
21+
else
22+
echo "libcurl4-openssl-dev is already installed."
23+
fi
24+
else
25+
echo "Non-Debian based Linux detected. Please ensure libcurl development libraries are installed."
26+
fi
27+
1428
elif [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
1529
# Windows
1630
MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe"
@@ -44,7 +58,6 @@ if conda info --envs | grep -q $ENV_NAME; then
4458
# Linux
4559
conda create --name $ENV_NAME python=3.10 pytorch=2.3.0 cudatoolkit=11.8 -c pytorch -c nvidia -y
4660
fi
47-
# conda activate $ENV_NAME
4861
else
4962
echo "Creating new environment $ENV_NAME..."
5063
if [[ "$OSTYPE" == "darwin"* ]]; then
@@ -54,19 +67,25 @@ else
5467
# Linux
5568
conda create --name $ENV_NAME python=3.10 pytorch=2.3.0 cudatoolkit=11.8 -c pytorch -c nvidia -y
5669
fi
57-
# conda activate $ENV_NAME
5870
fi
5971

60-
# source $HOME/miniconda/bin/activate $ENV_NAME
72+
# Activate the environment
73+
source $HOME/miniconda/bin/activate $ENV_NAME
74+
75+
# Install cmake via conda
76+
echo "Installing cmake..."
77+
conda install -y cmake
6178

62-
# Get full path of pip
79+
# Get full path of pip within the activated environment
6380
PIP_FULL_PATH=$(conda run -n $ENV_NAME which pip)
6481

65-
# Install other packages within the activated environment
66-
# Use PIP_FULL_PATH to run pip commands
82+
# Install other packages within the activated environment using pip
6783
$PIP_FULL_PATH install --upgrade pip
6884
$PIP_FULL_PATH install "xformers==0.0.26.post1"
69-
$PIP_FULL_PATH install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git@4e570be9ae4ced8cdc64e498125708e34942befc"
85+
$PIP_FULL_PATH install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git@038e6d4c8d40207a87297ab3aaf787c19b1006d1"
7086
$PIP_FULL_PATH install --no-deps "trl<0.9.0" peft accelerate bitsandbytes
87+
$PIP_FULL_PATH install unsloth_zoo
88+
$PIP_FULL_PATH install cut_cross_entropy
89+
$PIP_FULL_PATH install sentencepiece protobuf datasets huggingface_hub hf_transfer
7190

7291
echo "Setup completed successfully!"

‎praisonai/train.py

+235-137
Large diffs are not rendered by default.

‎pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "PraisonAI"
3-
version = "2.0.63"
3+
version = "2.0.64"
44
description = "PraisonAI is an AI Agents Framework with Self Reflection. PraisonAI application combines PraisonAI Agents, AutoGen, and CrewAI into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customisation, and efficient human-agent collaboration."
55
readme = "README.md"
66
license = ""
@@ -84,7 +84,7 @@ autogen = ["pyautogen>=0.2.19", "praisonai-tools>=0.0.7", "crewai"]
8484

8585
[tool.poetry]
8686
name = "PraisonAI"
87-
version = "2.0.63"
87+
version = "2.0.64"
8888
description = "PraisonAI is an AI Agents Framework with Self Reflection. PraisonAI application combines PraisonAI Agents, AutoGen, and CrewAI into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customisation, and efficient human–agent collaboration."
8989
authors = ["Mervin Praison"]
9090
license = ""

‎uv.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.