PraisonAI 0.0.59rc8__cp312-cp312-manylinux_2_35_x86_64.whl → 0.0.59rc11__cp312-cp312-manylinux_2_35_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of PraisonAI might be problematic. Click here for more details.

praisonai/cli.py CHANGED
@@ -12,6 +12,7 @@ import argparse
12
12
  from .auto import AutoGenerator
13
13
  from .agents_generator import AgentsGenerator
14
14
  from .inbuilt_tools import *
15
+ from .inc.config import generate_config
15
16
  import shutil
16
17
  import subprocess
17
18
  import logging
@@ -130,17 +131,20 @@ class PraisonAI:
130
131
 
131
132
  if args.agent_file == 'train':
132
133
  package_root = os.path.dirname(os.path.abspath(__file__))
133
- config_yaml_source = os.path.join(package_root, 'setup', 'config.yaml')
134
134
  config_yaml_destination = os.path.join(os.getcwd(), 'config.yaml')
135
135
 
136
- if not os.path.exists(config_yaml_destination):
137
- try:
138
- shutil.copyfile(config_yaml_source, config_yaml_destination)
139
- print("config.yaml copied to the current directory.")
140
- except FileExistsError:
141
- print("config.yaml already exists in the current directory. Skipping copy.")
142
- else:
143
- print("config.yaml already exists in the current directory. Skipping copy.")
136
+ # Generate config.yaml using the function
137
+ config = generate_config(
138
+ model_name=args.model,
139
+ hf_model_name=args.hf,
140
+ ollama_model_name=args.ollama,
141
+ dataset=[{
142
+ "name": args.dataset
143
+ }]
144
+ )
145
+ with open('config.yaml', 'w') as f:
146
+ yaml.dump(config, f, default_flow_style=False, indent=2)
147
+
144
148
 
145
149
  if 'init' in sys.argv:
146
150
  from praisonai.setup.setup_conda_env import main as setup_conda_main
@@ -150,12 +154,12 @@ class PraisonAI:
150
154
 
151
155
  try:
152
156
  result = subprocess.check_output(['conda', 'env', 'list'])
153
- if 'prasion_env' in result.decode('utf-8'):
154
- print("Conda environment 'prasion_env' found.")
157
+ if 'praison_env' in result.decode('utf-8'):
158
+ print("Conda environment 'praison_env' found.")
155
159
  else:
156
160
  raise subprocess.CalledProcessError(1, 'grep')
157
161
  except subprocess.CalledProcessError:
158
- print("Conda environment 'prasion_env' not found. Setting it up...")
162
+ print("Conda environment 'praison_env' not found. Setting it up...")
159
163
  from praisonai.setup.setup_conda_env import main as setup_conda_main
160
164
  setup_conda_main()
161
165
  print("All packages installed.")
@@ -167,7 +171,7 @@ class PraisonAI:
167
171
  env = os.environ.copy()
168
172
  env['PYTHONUNBUFFERED'] = '1'
169
173
 
170
- stream_subprocess(['conda', 'run', '--no-capture-output', '--name', 'prasion_env', 'python', '-u', train_script_path, 'train'] + train_args, env=env)
174
+ stream_subprocess(['conda', 'run', '--no-capture-output', '--name', 'praison_env', 'python', '-u', train_script_path, 'train'] + train_args, env=env)
171
175
  return
172
176
 
173
177
  invocation_cmd = "praisonai"
@@ -240,7 +244,11 @@ class PraisonAI:
240
244
  parser.add_argument("--auto", nargs=argparse.REMAINDER, help="Enable auto mode and pass arguments for it")
241
245
  parser.add_argument("--init", nargs=argparse.REMAINDER, help="Enable auto mode and pass arguments for it")
242
246
  parser.add_argument("agent_file", nargs="?", help="Specify the agent file")
243
- parser.add_argument("--deploy", action="store_true", help="Deploy the application") # New argument
247
+ parser.add_argument("--deploy", action="store_true", help="Deploy the application")
248
+ parser.add_argument("--model", type=str, help="Model name")
249
+ parser.add_argument("--hf", type=str, help="Hugging Face model name")
250
+ parser.add_argument("--ollama", type=str, help="Ollama model name")
251
+ parser.add_argument("--dataset", type=str, help="Dataset name for training", default="yahma/alpaca-cleaned")
244
252
  args, unknown_args = parser.parse_known_args()
245
253
 
246
254
  if unknown_args and unknown_args[0] == '-b' and unknown_args[1] == 'api:app':
praisonai/deploy.py CHANGED
@@ -56,7 +56,7 @@ class CloudDeployer:
56
56
  file.write("FROM python:3.11-slim\n")
57
57
  file.write("WORKDIR /app\n")
58
58
  file.write("COPY . .\n")
59
- file.write("RUN pip install flask praisonai==0.0.59rc8 gunicorn markdown\n")
59
+ file.write("RUN pip install flask praisonai==0.0.59rc11 gunicorn markdown\n")
60
60
  file.write("EXPOSE 8080\n")
61
61
  file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
62
62
 
@@ -0,0 +1,96 @@
1
+ def generate_config(
2
+ ollama_save=None,
3
+ huggingface_save=None,
4
+ train=None,
5
+ model_name=None,
6
+ hf_model_name=None,
7
+ ollama_model_name=None,
8
+ model_parameters=None,
9
+ max_seq_length=None,
10
+ load_in_4bit=None,
11
+ lora_r=None,
12
+ lora_target_modules=None,
13
+ lora_alpha=None,
14
+ lora_dropout=None,
15
+ lora_bias=None,
16
+ use_gradient_checkpointing=None,
17
+ random_state=None,
18
+ use_rslora=None,
19
+ loftq_config=None,
20
+ dataset=None,
21
+ dataset_text_field=None,
22
+ dataset_num_proc=None,
23
+ packing=None,
24
+ per_device_train_batch_size=None,
25
+ gradient_accumulation_steps=None,
26
+ warmup_steps=None,
27
+ num_train_epochs=None,
28
+ max_steps=None,
29
+ learning_rate=None,
30
+ logging_steps=None,
31
+ optim=None,
32
+ weight_decay=None,
33
+ lr_scheduler_type=None,
34
+ seed=None,
35
+ output_dir=None,
36
+ quantization_method=None
37
+ ):
38
+ """Generates the configuration for PraisonAI with dynamic overrides."""
39
+
40
+ config = {
41
+ "ollama_save": ollama_save or "false",
42
+ "huggingface_save": huggingface_save or "false",
43
+ "train": train or "false",
44
+
45
+ "model_name": model_name or "unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit",
46
+ "hf_model_name": hf_model_name or "mervinpraison/llama-3.1-tamilan-8B-test",
47
+ "ollama_model": ollama_model_name or "mervinpraison/llama3.1-tamilan-test",
48
+ "model_parameters": model_parameters or "8b",
49
+
50
+ "dataset": dataset or [
51
+ {
52
+ "name": "yahma/alpaca-cleaned",
53
+ "split_type": "train",
54
+ "processing_func": "format_prompts",
55
+ "rename": {"input": "input", "output": "output", "instruction": "instruction"},
56
+ "filter_data": False,
57
+ "filter_column_value": "id",
58
+ "filter_value": "alpaca",
59
+ "num_samples": 20000
60
+ }
61
+ ],
62
+
63
+ "dataset_text_field": dataset_text_field or "text",
64
+ "dataset_num_proc": dataset_num_proc or 2,
65
+ "packing": packing or False,
66
+
67
+ "max_seq_length": max_seq_length or 2048,
68
+ "load_in_4bit": load_in_4bit or True,
69
+ "lora_r": lora_r or 16,
70
+ "lora_target_modules": lora_target_modules or [
71
+ "q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"
72
+ ],
73
+ "lora_alpha": lora_alpha or 16,
74
+ "lora_dropout": lora_dropout or 0,
75
+ "lora_bias": lora_bias or "none",
76
+ "use_gradient_checkpointing": use_gradient_checkpointing or "unsloth",
77
+ "random_state": random_state or 3407,
78
+ "use_rslora": use_rslora or False,
79
+ "loftq_config": loftq_config or None,
80
+
81
+ "per_device_train_batch_size": per_device_train_batch_size or 2,
82
+ "gradient_accumulation_steps": gradient_accumulation_steps or 2,
83
+ "warmup_steps": warmup_steps or 5,
84
+ "num_train_epochs": num_train_epochs or 1,
85
+ "max_steps": max_steps or 10,
86
+ "learning_rate": learning_rate or 2.0e-4,
87
+ "logging_steps": logging_steps or 1,
88
+ "optim": optim or "adamw_8bit",
89
+ "weight_decay": weight_decay or 0.01,
90
+ "lr_scheduler_type": lr_scheduler_type or "linear",
91
+ "seed": seed or 3407,
92
+ "output_dir": output_dir or "outputs",
93
+
94
+ "quantization_method": quantization_method or ["q4_k_m"]
95
+ }
96
+ return config
@@ -1,5 +1,12 @@
1
+ ollama_save: "true"
2
+ huggingface_save: "true"
3
+ train: "true"
4
+
1
5
  model_name: "unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit"
2
6
  hf_model_name: "mervinpraison/llama-3.1-tamilan-8B-test"
7
+ ollama_model: "mervinpraison/llama3.1-tamilan-test"
8
+ model_parameters: "8b"
9
+
3
10
  max_seq_length: 2048
4
11
  load_in_4bit: true
5
12
  lora_r: 16
@@ -50,9 +57,4 @@ seed: 3407
50
57
  output_dir: "outputs"
51
58
 
52
59
  quantization_method:
53
- - "q4_k_m"
54
- - "q8_0"
55
- - "q5_k_m"
56
-
57
- ollama_model: "llama3.1-tamilan-test"
58
- model_parameters: "8b"
60
+ - "q4_k_m"
@@ -33,7 +33,7 @@ else
33
33
  fi
34
34
 
35
35
  # Create and activate the Conda environment
36
- ENV_NAME="prasion_env"
36
+ ENV_NAME="praison_env"
37
37
  if conda info --envs | grep -q $ENV_NAME; then
38
38
  echo "Environment $ENV_NAME already exists. Recreating..."
39
39
  conda env remove -y -n $ENV_NAME # Remove existing environment
praisonai/train.py CHANGED
@@ -3,6 +3,7 @@ import os
3
3
  import sys
4
4
  import yaml
5
5
  import torch
6
+ import shutil
6
7
  from transformers import TextStreamer
7
8
  from unsloth import FastLanguageModel, is_bfloat16_supported
8
9
  from trl import SFTTrainer
@@ -178,7 +179,7 @@ class train:
178
179
 
179
180
  def prepare_modelfile_content(self):
180
181
  output_model = self.config["hf_model_name"]
181
- return f"""FROM {output_model}/unsloth.Q5_K_M.gguf
182
+ return f"""FROM {output_model}/unsloth.Q4_K_M.gguf
182
183
 
183
184
  TEMPLATE \"\"\"Below are some instructions that describe some tasks. Write responses that appropriately complete each request.{{{{ if .Prompt }}}}
184
185
 
@@ -209,11 +210,18 @@ PARAMETER stop "<|reserved_special_token_"
209
210
  self.check_gpu()
210
211
  self.check_ram()
211
212
  # self.install_packages()
212
- self.prepare_model()
213
- self.train_model()
214
- self.save_model_merged()
215
- self.push_model_gguf()
216
- self.create_and_push_ollama_model()
213
+ if self.config.get("train", "true").lower() == "true":
214
+ self.prepare_model()
215
+ self.train_model()
216
+
217
+ if self.config.get("huggingface_save", "true").lower() == "true":
218
+ self.save_model_merged()
219
+
220
+ if self.config.get("huggingface_save_gguf", "true").lower() == "true":
221
+ self.push_model_gguf()
222
+
223
+ if self.config.get("ollama_save", "true").lower() == "true":
224
+ self.create_and_push_ollama_model()
217
225
 
218
226
 
219
227
  def main():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PraisonAI
3
- Version: 0.0.59rc8
3
+ Version: 0.0.59rc11
4
4
  Summary: PraisonAI application combines AutoGen and CrewAI or similar frameworks into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customization, and efficient human-agent collaboration.
5
5
  Author: Mervin Praison
6
6
  Requires-Python: >=3.10,<3.13
@@ -3,11 +3,12 @@ praisonai/__main__.py,sha256=MVgsjMThjBexHt4nhd760JCqvP4x0IQcwo8kULOK4FQ,144
3
3
  praisonai/agents_generator.py,sha256=8d1WRbubvEkBrW1HZ7_xnGyqgJi0yxmXa3MgTIqef1c,19127
4
4
  praisonai/auto.py,sha256=9spTXqj47Hmmqv5QHRYE_RzSVHH_KoPbaZjskUj2UcE,7895
5
5
  praisonai/chainlit_ui.py,sha256=bNR7s509lp0I9JlJNvwCZRUZosC64qdvlFCt8NmFamQ,12216
6
- praisonai/cli.py,sha256=WQf6NG1xEcyE9ySR4ahSiVDxCkedGV6A0Yaf78uYXQ0,17411
7
- praisonai/deploy.py,sha256=NPP0aowNx4k7EMFaIIBKpcF9N6_jS4i0d6wj-crmMds,6031
6
+ praisonai/cli.py,sha256=Cz_oegYqZBRwWLpzbUiTVQRZqJJg38UgTBtnHFjk_HE,17648
7
+ praisonai/deploy.py,sha256=9qkDTiytzxjHKlso9sBSiMVPZTr9wJZQgdxZh8mhzd0,6032
8
8
  praisonai/inbuilt_tools/__init__.py,sha256=mUKnbL6Gram9c9f2m8wJwEzURBLmPEOcHzwySBH89YA,74
9
9
  praisonai/inbuilt_tools/autogen_tools.py,sha256=svYkM2N7DVFvbiwgoAS7U_MqTOD8rHf8VD3BaFUV5_Y,14907
10
10
  praisonai/inc/__init__.py,sha256=sPDlYBBwdk0VlWzaaM_lG0_LD07lS2HRGvPdxXJFiYg,62
11
+ praisonai/inc/config.py,sha256=ZjmgY9Bh3PjA74Gwdal-MvPj50CKITiKny0aoY7XWN4,3336
11
12
  praisonai/inc/models.py,sha256=1kwP9o56AvN8L38x7eeAzudjAvstN0uWu-woQkgxAe4,5449
12
13
  praisonai/public/android-chrome-192x192.png,sha256=ENJEqhDE3XEQViRhKNDezQKRiOiuHOUj5nzRN43fz50,6535
13
14
  praisonai/public/android-chrome-512x512.png,sha256=4txEwB0cJkxFVarRdvFGJZR1DtWJ2h-L_2cUEjBXHAc,15244
@@ -23,12 +24,12 @@ praisonai/public/movie.svg,sha256=aJ2EQ8vXZusVsF2SeuAVxP4RFJzQ14T26ejrGYdBgzk,12
23
24
  praisonai/public/thriller.svg,sha256=2dYY72EcgbEyTxS4QzjAm37Y4srtPWEW4vCMFki98ZI,3163
24
25
  praisonai/setup/__init__.py ,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
26
  praisonai/setup/build.py,sha256=NyTAXQ_UZ8vKo_KwCINp8ctmauZyCMDkw1rys3ay0ec,646
26
- praisonai/setup/config.yaml,sha256=t2WtEDT4JE4yVMAg7hKD18XER3qz41-V36HHYp07yEo,1162
27
+ praisonai/setup/config.yaml,sha256=pjThU3Mzp5ce2ZFb1GHnR3RviE9dhpwRz3ONd9JnnwE,1212
27
28
  praisonai/setup/post_install.py,sha256=hXukn_7bL64vE582SZcS-9MiZGeJj6hN7upoR1oJ-Bo,576
28
29
  praisonai/setup/setup_conda_env.py,sha256=4QiWrqgEObivzOMwfJgWaCPpUEpB68cQ6lFwVwFoufk,816
29
- praisonai/setup/setup_conda_env.sh,sha256=Ao5kCgIVamCcCKhrXWYELTUr5fQlRQmWwDYjuTxBH6s,2718
30
+ praisonai/setup/setup_conda_env.sh,sha256=te7s0KHsTi7XM-vkNvE0dKC1HeU2tXxqE-sPUScV6fY,2718
30
31
  praisonai/test.py,sha256=OL-wesjA5JTohr8rtr6kWoaS4ImkJg2l0GXJ-dUUfRU,4090
31
- praisonai/train.py,sha256=Kuckd3TjW6ZYTISyXpL0upB-NibsEmwk1BMhRHPXba0,9200
32
+ praisonai/train.py,sha256=S4YPXXMypR_d6K_m0dcrDxFNanaOvXZq8tM2IenpmPs,9522
32
33
  praisonai/ui/chat.py,sha256=B4F1R7qP-0c-elg8WcRsYlr6-FkmHWtdunGIzU7WrDM,9321
33
34
  praisonai/ui/code.py,sha256=GcOr8lNah4AgI2RcIKmgjehzSl-KNu7x6UHrghixeaM,10095
34
35
  praisonai/ui/context.py,sha256=oWO2I_WBZb7kZnuXItf18EJX0ZQv-1nAd8rxhwhuuDU,11871
@@ -40,8 +41,8 @@ praisonai/ui/public/movie.svg,sha256=aJ2EQ8vXZusVsF2SeuAVxP4RFJzQ14T26ejrGYdBgzk
40
41
  praisonai/ui/public/thriller.svg,sha256=2dYY72EcgbEyTxS4QzjAm37Y4srtPWEW4vCMFki98ZI,3163
41
42
  praisonai/ui/sql_alchemy.py,sha256=HsyeRq-G9qbQobHWpTJHHKQiT4FvYw_7iuv-2PNh0IU,27419
42
43
  praisonai/version.py,sha256=ugyuFliEqtAwQmH4sTlc16YXKYbFWDmfyk87fErB8-8,21
43
- praisonai-0.0.59rc8.dist-info/LICENSE,sha256=kqvFysVlnFxYOu0HxCe2HlmZmJtdmNGOxWRRkT9TsWc,1035
44
- praisonai-0.0.59rc8.dist-info/METADATA,sha256=dEoosybwghG84UAGQ20-09RkFav2hC99gyQPZ7xhBTE,11151
45
- praisonai-0.0.59rc8.dist-info/WHEEL,sha256=HBsDV7Hj4OTiS1GX6ua7iQXUQTB9UHftbBxr7Q8Xm9c,110
46
- praisonai-0.0.59rc8.dist-info/entry_points.txt,sha256=jB078LEGLY3Ky_indhclomRIVVpXrPSksHjJ-tcBZ-o,133
47
- praisonai-0.0.59rc8.dist-info/RECORD,,
44
+ praisonai-0.0.59rc11.dist-info/LICENSE,sha256=kqvFysVlnFxYOu0HxCe2HlmZmJtdmNGOxWRRkT9TsWc,1035
45
+ praisonai-0.0.59rc11.dist-info/METADATA,sha256=oPMDxC8HHl-S91_BkN6RunO0LyP8SXnKSIjuHHF0Frc,11152
46
+ praisonai-0.0.59rc11.dist-info/WHEEL,sha256=HBsDV7Hj4OTiS1GX6ua7iQXUQTB9UHftbBxr7Q8Xm9c,110
47
+ praisonai-0.0.59rc11.dist-info/entry_points.txt,sha256=jB078LEGLY3Ky_indhclomRIVVpXrPSksHjJ-tcBZ-o,133
48
+ praisonai-0.0.59rc11.dist-info/RECORD,,