-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'comfyanonymous:master' into sa_solver
- Loading branch information
Showing
120 changed files
with
56,624 additions
and
48,236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: 'Close stale issues' | ||
on: | ||
schedule: | ||
# Run daily at 430 am PT | ||
- cron: '30 11 * * *' | ||
permissions: | ||
issues: write | ||
|
||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/stale@v9 | ||
with: | ||
stale-issue-message: "This issue is being marked stale because it has not had any activity for 30 days. Reply below within 7 days if your issue still isn't solved, and it will be left open. Otherwise, the issue will be closed automatically." | ||
days-before-stale: 30 | ||
days-before-close: 7 | ||
stale-issue-label: 'Stale' | ||
only-labels: 'User Support' | ||
exempt-all-assignees: true | ||
exempt-all-milestones: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Unit Tests | ||
|
||
on: | ||
push: | ||
branches: [ main, master ] | ||
pull_request: | ||
branches: [ main, master ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- name: Install requirements | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu | ||
pip install -r requirements.txt | ||
- name: Run Unit Tests | ||
run: | | ||
pip install -r tests-unit/requirements.txt | ||
python -m pytest tests-unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import logging | ||
from logging.handlers import MemoryHandler | ||
from collections import deque | ||
|
||
logs = None | ||
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") | ||
|
||
|
||
def get_logs(): | ||
return "\n".join([formatter.format(x) for x in logs]) | ||
|
||
|
||
def setup_logger(verbose: bool = False, capacity: int = 300): | ||
global logs | ||
if logs: | ||
return | ||
|
||
# Setup default global logger | ||
logger = logging.getLogger() | ||
logger.setLevel(logging.DEBUG if verbose else logging.INFO) | ||
|
||
stream_handler = logging.StreamHandler() | ||
stream_handler.setFormatter(logging.Formatter("%(message)s")) | ||
logger.addHandler(stream_handler) | ||
|
||
# Create a memory handler with a deque as its buffer | ||
logs = deque(maxlen=capacity) | ||
memory_handler = MemoryHandler(capacity, flushLevel=logging.INFO) | ||
memory_handler.buffer = logs | ||
memory_handler.setFormatter(formatter) | ||
logger.addHandler(memory_handler) |
Oops, something went wrong.