pilot.linkstec 0.0.13__tar.gz → 0.0.15__tar.gz
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 pilot.linkstec might be problematic. Click here for more details.
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/PKG-INFO +1 -1
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/pyproject.toml +1 -1
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/generater/vertexai.py +1 -2
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/job/impl/base_job.py +17 -1
- pilot_linkstec-0.0.15/src/pilot/logging/logger.py +57 -0
- pilot_linkstec-0.0.15/src/pilot/util/__init__.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot.linkstec.egg-info/PKG-INFO +1 -1
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot.linkstec.egg-info/SOURCES.txt +2 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/LICENSE +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/README.md +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/setup.cfg +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/__init__.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/config/__init__.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/config/config_reader.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/control/__init__.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/control/control_interface.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/control/impl/__init__.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/control/impl/base_controller.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/conver/__init__.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/conver/converfileEncodding.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/conver/nkf_converter.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/generater/__init__.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/job/__init__.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/job/impl/__init__.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/job/job_interface.py +0 -0
- {pilot_linkstec-0.0.13/src/pilot/splitters → pilot_linkstec-0.0.15/src/pilot/logging}/__init__.py +0 -0
- {pilot_linkstec-0.0.13/src/pilot/unit → pilot_linkstec-0.0.15/src/pilot/splitters}/__init__.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/splitters/cobolsplitter.py +0 -0
- {pilot_linkstec-0.0.13/src/pilot/unit/impl → pilot_linkstec-0.0.15/src/pilot/unit}/__init__.py +0 -0
- {pilot_linkstec-0.0.13/src/pilot/util → pilot_linkstec-0.0.15/src/pilot/unit/impl}/__init__.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/unit/impl/base_unit.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/unit/unit_interface.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot/util/files.py +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot.linkstec.egg-info/dependency_links.txt +0 -0
- {pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot.linkstec.egg-info/top_level.txt +0 -0
|
@@ -24,7 +24,7 @@ class VertexAISingleton:
|
|
|
24
24
|
with self._lock:
|
|
25
25
|
if not self._initialized:
|
|
26
26
|
self.model = GenerativeModel(model_name)
|
|
27
|
-
|
|
27
|
+
self.encoding = tiktoken.get_encoding("cl100k_base")
|
|
28
28
|
self._initialized = True
|
|
29
29
|
|
|
30
30
|
def generate_content(self, prompt: str) -> Dict[str, Any]:
|
|
@@ -52,7 +52,6 @@ class VertexAISingleton:
|
|
|
52
52
|
def count_tokens(self, text: str) -> int:
|
|
53
53
|
"""与えられたテキストのトークン数を返す(bert-base-uncasedのみ使用)"""
|
|
54
54
|
try:
|
|
55
|
-
self.encoding = tiktoken.get_encoding("cl100k_base")
|
|
56
55
|
tokens = self.encoding.encode(text)
|
|
57
56
|
return len(tokens)
|
|
58
57
|
except Exception as e:
|
|
@@ -325,4 +325,20 @@ class BaseJob(JobInterface):
|
|
|
325
325
|
open(end_file, 'w', encoding='utf-8').close()
|
|
326
326
|
return end_file
|
|
327
327
|
|
|
328
|
-
return None
|
|
328
|
+
return None
|
|
329
|
+
|
|
330
|
+
def pre_run(self):
|
|
331
|
+
"""
|
|
332
|
+
ジョブ実行前の前処理を行うメソッド。
|
|
333
|
+
必要に応じてサブクラスでオーバーライドして使用する。
|
|
334
|
+
"""
|
|
335
|
+
pass
|
|
336
|
+
|
|
337
|
+
def post_run(self):
|
|
338
|
+
"""
|
|
339
|
+
ジョブ実行後の後処理を行うメソッド。
|
|
340
|
+
必要に応じてサブクラスでオーバーライドして使用する。
|
|
341
|
+
"""
|
|
342
|
+
pass
|
|
343
|
+
|
|
344
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
import sys
|
|
3
|
+
import threading
|
|
4
|
+
|
|
5
|
+
# コンソールカラーのコード定義
|
|
6
|
+
RESET = "\x1b[0m"
|
|
7
|
+
COLOR_MAP = {
|
|
8
|
+
logging.DEBUG: "\x1b[37m", # 白色
|
|
9
|
+
logging.INFO: "\x1b[32m", # 緑色
|
|
10
|
+
logging.WARNING: "\x1b[33m", # 黄色
|
|
11
|
+
logging.ERROR: "\x1b[31m", # 赤色
|
|
12
|
+
logging.CRITICAL: "\x1b[41m", # 赤背景白文字
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ColoredFormatter(logging.Formatter):
|
|
17
|
+
def format(self, record):
|
|
18
|
+
color = COLOR_MAP.get(record.levelno, RESET)
|
|
19
|
+
# スレッド名を取得
|
|
20
|
+
thread_name = threading.current_thread().name
|
|
21
|
+
thread_name = thread_name.split('_', 1)[1] if '_' in thread_name else thread_name
|
|
22
|
+
# クラス名、メソッド名、行番号
|
|
23
|
+
prefix = f"{self.formatTime(record, '%Y-%m-%d %H:%M:%S')} " \
|
|
24
|
+
f"[{record.levelname}] " \
|
|
25
|
+
f"[{thread_name}] " \
|
|
26
|
+
f"[{record.module}.{record.funcName}:{record.lineno}]"
|
|
27
|
+
message = super().format(record)
|
|
28
|
+
return f"{color}{prefix} {message}{RESET}"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
_global_logger_configured = False
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def setup_global_logger(log_level: int = logging.INFO):
|
|
35
|
+
global _global_logger_configured
|
|
36
|
+
|
|
37
|
+
if not _global_logger_configured:
|
|
38
|
+
logging.basicConfig(
|
|
39
|
+
level=log_level,
|
|
40
|
+
format='%(message)s'
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
root_logger = logging.getLogger()
|
|
44
|
+
if root_logger.handlers:
|
|
45
|
+
root_logger.handlers.clear()
|
|
46
|
+
|
|
47
|
+
handler = logging.StreamHandler(sys.stdout)
|
|
48
|
+
formatter = ColoredFormatter('%(message)s')
|
|
49
|
+
handler.setFormatter(formatter)
|
|
50
|
+
root_logger.addHandler(handler)
|
|
51
|
+
root_logger.setLevel(log_level)
|
|
52
|
+
|
|
53
|
+
_global_logger_configured = True
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def get_logger(name: str) -> logging.Logger:
|
|
57
|
+
return logging.getLogger(name)
|
|
File without changes
|
|
@@ -21,6 +21,8 @@ src/pilot/job/__init__.py
|
|
|
21
21
|
src/pilot/job/job_interface.py
|
|
22
22
|
src/pilot/job/impl/__init__.py
|
|
23
23
|
src/pilot/job/impl/base_job.py
|
|
24
|
+
src/pilot/logging/__init__.py
|
|
25
|
+
src/pilot/logging/logger.py
|
|
24
26
|
src/pilot/splitters/__init__.py
|
|
25
27
|
src/pilot/splitters/cobolsplitter.py
|
|
26
28
|
src/pilot/unit/__init__.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pilot_linkstec-0.0.13/src/pilot/splitters → pilot_linkstec-0.0.15/src/pilot/logging}/__init__.py
RENAMED
|
File without changes
|
{pilot_linkstec-0.0.13/src/pilot/unit → pilot_linkstec-0.0.15/src/pilot/splitters}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{pilot_linkstec-0.0.13/src/pilot/unit/impl → pilot_linkstec-0.0.15/src/pilot/unit}/__init__.py
RENAMED
|
File without changes
|
{pilot_linkstec-0.0.13/src/pilot/util → pilot_linkstec-0.0.15/src/pilot/unit/impl}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pilot_linkstec-0.0.13 → pilot_linkstec-0.0.15}/src/pilot.linkstec.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|