Skip to content

Commit

Permalink
Merge branch 'xlab-uiuc:acto-dev' into acto-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
TZ-zzz authored Sep 6, 2024
2 parents c20f971 + 1c3764d commit 75aa2f5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions acto/input/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ def __init__(
for doc in docs:
example_docs.append(doc)
for example_doc in example_docs:
logger = get_thread_logger(with_prefix=True)
logger.info("Loading example document %s", example_doc)
self.root_schema.load_examples(example_doc)

self.num_workers = num_workers
Expand Down
6 changes: 4 additions & 2 deletions acto/schema/array.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import logging
import random
from typing import List, Tuple

from acto.utils.thread_logger import get_thread_logger

from .base import BaseSchema, TreeNode


Expand Down Expand Up @@ -102,7 +103,8 @@ def to_tree(self) -> TreeNode:
return node

def load_examples(self, example: list):
logging.debug(f"Loading example {example} into {self}")
logger = get_thread_logger(with_prefix=True)
logger.debug(f"Loading example {example} into {self}")
self.examples.append(example)
for item in example:
self.item_schema.load_examples(item)
Expand Down
4 changes: 2 additions & 2 deletions acto/schema/object.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import logging
import random
from typing import List, Tuple

Expand Down Expand Up @@ -130,7 +129,8 @@ def to_tree(self) -> TreeNode:
return node

def load_examples(self, example: dict):
logging.debug(f"Loading example {example} into {self}")
logger = get_thread_logger(with_prefix=True)
logger.debug(f"Loading example {example} into {self}")
self.examples.append(example)
for key, value in example.items():
if key in self.properties:
Expand Down
5 changes: 3 additions & 2 deletions acto/schema/string.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import logging
import random
from typing import List, Optional, Tuple

import exrex

from acto.common import random_string
from acto.utils.thread_logger import get_thread_logger

from .base import BaseSchema, TreeNode

Expand Down Expand Up @@ -48,7 +48,8 @@ def to_tree(self) -> TreeNode:
return TreeNode(self.path)

def load_examples(self, example: str):
logging.debug(f"Loading example {example} into {self}")
logger = get_thread_logger(with_prefix=True)
logger.debug(f"Loading example {example} into {self}")
self.examples.append(example)

def set_default(self, instance):
Expand Down

0 comments on commit 75aa2f5

Please sign in to comment.