Unix Program Shortcuts
Need to transfer data locally or remote? Support efficient re-connect and dedupe? Want summary progress information?
rsync -a --info=progress2 --recursive [SOURCE] ... [DEST]
Hugging Face Optimized Inference License 1.0 (HFOILv1.0) | |
This License Agreement governs the use of the Software and its Modifications. It is a | |
binding agreement between the Licensor and You. | |
This License Agreement shall be referred to as Hugging Face Optimized Inference License | |
1.0 or HFOILv1.0. We may publish revised versions of this License Agreement from time to | |
time. Each version will be given a distinguished number. |
from dataclasses import dataclass | |
from typing import Collection, Dict, Iterator, Optional, Set | |
import torch | |
def torchscript(model: torch.nn.Module) -> torch.ScriptModule: | |
"""Runs TorchScript's scripting mode on the input model. | |
A torch scripted model is able to run in a Python-free execution environment, | |
ideal for production inference. |
from concurrent.futures import ProcessPoolExecutor | |
from multiprocessing import BoundedSemaphore | |
from typing import Optional, Sequence | |
from concurrent_utils import BoundedPoolExecutor | |
__all__: Sequence[str] = ("BoundedProcessPoolExecutor",) | |
class BoundedProcessPoolExecutor(ProcessPoolExecutor, BoundedPoolExecutor): |
from concurrent.futures import ThreadPoolExecutor | |
from threading import BoundedSemaphore, Lock | |
from typing import Optional, Sequence | |
from concurrent_utils import BoundedPoolExecutor | |
__all__: Sequence[str] = ( | |
"BoundedThreadPoolExecutor", | |
"IsDone", | |
) |
import threading | |
from abc import ABC | |
from concurrent.futures import Executor, Future | |
from multiprocessing import synchronize | |
from typing import Optional, Sequence, Union | |
__all__: Sequence[str] = ("BoundedPoolExecutor",) | |
class BoundedPoolExecutor(ABC, Executor): |
from abc import ABC | |
from typing import Any, Iterable, Tuple | |
from dataclasses import dataclass | |
from functools import partial | |
@dataclass | |
class TupleDestructureSyntax(ABC): | |
"""Allows any @dataclass class to be decomposed into its fields & values as if it were a tuple. | |
from enum import Enum | |
from typing import Callable, Optional, Type, TypeVar | |
class EnumStr(str, Enum): | |
pass | |
E = TypeVar('E', bound=EnumStr) |
""" | |
Use as: | |
REPO='ecr-repo-name' BRANCH='main' python git_branch_commits_in_ecr_repo.py | |
You can pipe this to `cut -f1 -s` to get the commits only. Or `-f2` to get the pushed by date only. | |
These values are separated by a tab (`"\t"`). | |
""" | |
import json | |
import os |
import traceback | |
from abc import ABC, abstractmethod | |
from dataclasses import dataclass | |
from typing import Iterator, Sequence, Union | |
import torch | |
from core_utils.common import type_name | |
__all__: Sequence[str] = ( | |
"descent_script", |