Skip to content

Commit

Permalink
Fix logging issues
Browse files Browse the repository at this point in the history
  • Loading branch information
homanp committed Oct 22, 2023
1 parent 6e5b43f commit 3361e80
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 42 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ superenv/
venv/
/.vscode
/.codesandbox
.pypirc
.pypirc
dist/
Binary file removed dist/nagato_ai-0.0.8-py3-none-any.whl
Binary file not shown.
Binary file removed dist/nagato_ai-0.0.8.tar.gz
Binary file not shown.
11 changes: 9 additions & 2 deletions nagato/service/finetune.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# flake8: noqa

import sys
import requests
import json
import os
Expand Down Expand Up @@ -70,7 +71,9 @@ def generate_dataset(self) -> str:
with open(training_file, "w") as f:
with ThreadPoolExecutor() as executor:
progress_bar = tqdm(
total=total_pairs, desc="Generating synthetic Q&A pairs"
total=total_pairs,
desc="Generating synthetic Q&A pairs",
file=sys.stdout,
)
for i in range(
0, len(self.nodes), self.batch_size
Expand Down Expand Up @@ -163,7 +166,11 @@ def validate_dataset(self, training_file: str) -> str:
with open(training_file, "r") as f:
lines = f.readlines()
total_lines = len(lines)
progress_bar = tqdm(total=total_lines, desc="Validating lines")
progress_bar = tqdm(
total=total_lines,
desc="Validating lines",
file=sys.stdout,
)
for i, line in enumerate(lines, start=1):
try:
data = json.loads(line)
Expand Down
2 changes: 1 addition & 1 deletion nagato/utils/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def setup_logger():
style="%",
)

logger = colorlog.getLogger("example")
logger = colorlog.getLogger(__name__)
handler = logging.StreamHandler()
handler.setFormatter(formatter)
logger.addHandler(handler)
Expand Down
57 changes: 26 additions & 31 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nagato-ai"
version = "0.0.8"
version = "0.0.15"
description = ""
authors = ["Ismail Pelaseyed"]
readme = "./README.md"
Expand All @@ -18,7 +18,6 @@ unstructured = "^0.10.16"
requests = "^2.31.0"
colorlog = "^6.7.0"
vulture = "^2.7"
asyncio = "^3.4.3"
llama-index = "^0.8.37"
pypdf = "^3.16.2"
tiktoken = "^0.5.1"
Expand All @@ -27,7 +26,7 @@ replicate = "^0.15.4"
wheel = "^0.41.0"
python-dotenv = "^1.0.0"
tqdm = "^4.66.1"
decouple = "^0.0.7"
setuptools = "^68.2.2"

[build-system]
requires = ["poetry-core"]
Expand Down
29 changes: 25 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from setuptools import find_packages, setup
from setuptools import setup

setup(
name="nagato-ai",
version="0.0.1",
packages=find_packages(),
description="The open framework for finetuning LLMs on private data",
version="0.0.14",
packages=["nagato"],
description="The open framework for Q&A finetuning LLMs on private data",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
author="Ismail Pelaseyed",
Expand All @@ -14,4 +14,25 @@
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
],
install_requires=[
"python-decouple>=3.8",
"pydantic>=1.10.7",
"flake8>=6.0.0",
"ruff>=0.0.265",
"black>=23.3.0",
"pinecone-client>=2.2.2",
"unstructured>=0.10.16",
"requests>=2.31.0",
"colorlog>=6.7.0",
"vulture>=2.7",
"llama-index>=0.8.37",
"pypdf>=3.16.2",
"tiktoken>=0.5.1",
"sentence-transformers>=2.2.2",
"replicate>=0.15.4",
"wheel>=0.41.0",
"python-dotenv>=1.0.0",
"tqdm>=4.66.1",
"setuptools>=68.2.2",
],
)

0 comments on commit 3361e80

Please sign in to comment.