Set Max Tokens Env Variable

This commit is contained in:
MervinPraison committed 2024-07-13 02:16:28 +01:00
1 parent 4ac449bb4b
commit 8985715b55
6 files changed
+20 -6

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
FROM python:3.11-slim
WORKDIR /app
COPY . .
RUN pip install flask praisonai==0.0.49 gunicorn markdown
RUN pip install flask praisonai==0.0.50 gunicorn markdown
EXPOSE 8080
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]
+1 -1
View File
@@ -110,7 +110,7 @@ Loads environment variables from .env file or system and sets them.</p>
file.write(&#34;FROM python:3.11-slim\n&#34;)
file.write(&#34;WORKDIR /app\n&#34;)
file.write(&#34;COPY . .\n&#34;)
file.write(&#34;RUN pip install flask praisonai==0.0.49 gunicorn markdown\n&#34;)
file.write(&#34;RUN pip install flask praisonai==0.0.50 gunicorn markdown\n&#34;)
file.write(&#34;EXPOSE 8080\n&#34;)
file.write(&#39;CMD [&#34;gunicorn&#34;, &#34;-b&#34;, &#34;0.0.0.0:8080&#34;, &#34;api:app&#34;]\n&#39;)
+14
View File
@@ -67,3 +67,17 @@ code:
```bash
export PRAISONAI_IGNORE_FILES=".*,*.pyc,__pycache__,.git,.gitignore,.vscode,.idea,.DS_Store,*.lock,.env,docs,tests,test,tmp,temp,*.txt,*.md,*.json,*.csv,*.tsv,public,*.sql,*.sqlite,*.db,*.db3,*.sqlite3,*.log,*.zip,*.gz,*.tar,*.rar,*.7z,*.pdf,*.jpg,*.jpeg,*.png,*.gif,*.svg,cookbooks,assets,dist,build,node_modules,venv,crewAI,.cache,*.__pycache__,*chroma.sqlite3,test/,dist/,praisonAI.egg-info,test.yaml,db,praisonai_prompt.txt,watch.sh,docs.sh,other,output,*.chainlit,.files,site,flagged,*public,threads.db,trained_agents_data.pkl,.pytest_cache"
```
## Set Max Tokens
```bash
export PRAISONAI_MAX_TOKENS=200000
```
or
* Create a .env file in the root folder of the project
* Add below Variables and required Max Tokens
* ```
PRAISONAI_MAX_TOKENS=200000
```
+1 -1
View File
@@ -56,7 +56,7 @@ class CloudDeployer:
file.write("FROM python:3.11-slim\n")
file.write("WORKDIR /app\n")
file.write("COPY . .\n")
file.write("RUN pip install flask praisonai==0.0.49 gunicorn markdown\n")
file.write("RUN pip install flask praisonai==0.0.50 gunicorn markdown\n")
file.write("EXPOSE 8080\n")
file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
+2 -2
View File
@@ -20,12 +20,12 @@ logger.setLevel(log_level)
class ContextGatherer:
def __init__(self, directory='.', output_file='context.txt',
relevant_extensions=None, max_file_size=1_000_000, max_tokens=60000):
relevant_extensions=None, max_file_size=1_000_000, max_tokens=128000):
self.directory = directory
self.output_file = output_file
self.relevant_extensions = relevant_extensions or ['.py']
self.max_file_size = max_file_size
self.max_tokens = max_tokens
self.max_tokens = int(os.getenv("PRAISONAI_MAX_TOKENS", max_tokens))
self.ignore_patterns = self.get_ignore_patterns()
def get_ignore_patterns(self):
+1 -1
View File
@@ -1,6 +1,6 @@
[tool.poetry]
name = "PraisonAI"
version = "0.0.49"
version = "0.0.50"
description = "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."
authors = ["Mervin Praison"]
license = ""