From 5343106155c3229b2a34cf957b1e9d1ece19d5fb Mon Sep 17 00:00:00 2001 From: glorenzo972 Date: Thu, 2 May 2024 14:28:44 +0200 Subject: [PATCH] modified: log_conf.json to INFO Level --- CHANGELOG.md | 5 +++++ log_conf.json | 16 ++++++++-------- pyproject.toml | 2 +- tilellm/store/pinecone_repository.py | 3 ++- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47d6057..62a12c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ ## [2024-05-02] +### 0.1.11 +- fixed: log_conf.json + +## [2024-05-02] + ### 0.1.10 - fixed: any fields of metadata cannot be None. - added: TILELLM_ROLE=qa|train in order to manage qa and train diff --git a/log_conf.json b/log_conf.json index 4f0952f..b7d45c4 100644 --- a/log_conf.json +++ b/log_conf.json @@ -4,31 +4,31 @@ "level": "DEBUG", "propagate": false, "handlers": [ - "console", - "file" + "stdout", + "stderr" ] } }, "version": 1, "disable_existing_loggers": false, "handlers": { - "console": { + "stdout": { "formatter": "simple", "class": "logging.StreamHandler", "stream": "ext://sys.stdout", "level": "DEBUG" }, - "file": { - "level": "INFO", + "stderr": { + "level": "ERROR", "formatter": "simple", - "class": "logging.FileHandler", - "filename": "myapp.log" + "class": "logging.StreamHandler", + "stream": "ext://sys.stderr" } }, "root": { "level": "INFO", "handlers": [ - "console" + "stdout","stderr" ] }, "formatters": { diff --git a/pyproject.toml b/pyproject.toml index ed9d7a2..81d55c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "tilellm" -version = "0.1.10" +version = "0.1.11" description = "tiledesk for RAG" authors = ["Gianluca Lorenzo "] repository = "https://github.com/Tiledesk/tiledesk-llm" diff --git a/tilellm/store/pinecone_repository.py b/tilellm/store/pinecone_repository.py index 22332cd..63ea147 100644 --- a/tilellm/store/pinecone_repository.py +++ b/tilellm/store/pinecone_repository.py @@ -75,7 +75,8 @@ async def add_pc_item(item): text_key=const.PINECONE_TEXT_KEY) total_tokens, cost = calc_embedding_cost(chunks, embedding) - logger.info(len(chunks), total_tokens, cost) + logger.info(f"chunks: {len(chunks)}, total_tokens: {total_tokens}, cost: {cost: .6f}") + # from pprint import pprint # pprint(documents) elif type_source == 'urlbs':