license compliance stuff and other changes

relicense to AGPLv3
comply with the MPL's file copyleft
some other changes in the direction of supporting GPT-2 which were hard to untangle from the rest of the changes (sorry)
This commit is contained in:
io 2021-07-26 04:52:13 +00:00
parent 944e2fc3a5
commit c22a493dff
12 changed files with 859 additions and 436 deletions

12
utils.py Normal file
View file

@ -0,0 +1,12 @@
# SPDX-License-Identifier: AGPL-3.0-only
import anyio
import functools
from bs4 import BeautifulSoup
def shield(f):
@functools.wraps(f)
async def shielded(*args, **kwargs):
with anyio.CancelScope(shield=True) as cs:
return await f(*args, **kwargs)
return shielded