No project description provided
Project description
Facehugger Shield
Facehugger Shield automatically locks down operations for specific modules. It was designed to non-destructively restrict access to the Huggingface library, but can be used with any library.
Usage
Facehugger Shield was specifically designed to override Huggingface libraries, so the following examples show how to do that.
Install with Huggingface libraries (or any other library you want to restrict).
pip install facehuggershield
Import in your application's main entry file (e.g. main.py
), import facehuggershield
before importing
any other libraries.
import facehuggershield.huggingface
Now you can use Huggingface libraries without worrying about telemetry, networking or file writes.
How it works
Facehugger Shield uses nullscream
to intercept blacklisted modules and return Noop modules in their place.
The noop modules are empty classes with functions that return Magic noop classes.
The magic class functions in turn respond with Magic classes.
This allows anything on the blacklist to be importable, but not executable.
By overriding certain functions in the transformers
library, Facehugger is able to prevent
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file facehuggershield-0.1.6.tar.gz
.
File metadata
- Download URL: facehuggershield-0.1.6.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbcb99d2579bf5c0a1e15c84b07af890ad3a850505916e6260fced10d686d01e |
|
MD5 | ec4ec8511226a177b131af037b6ec627 |
|
BLAKE2b-256 | 862adab9556fdc798985bc2e4e3db9efcc3b8d9dd8ce0d1cf595032b8c5a30d6 |
File details
Details for the file facehuggershield-0.1.6-py3-none-any.whl
.
File metadata
- Download URL: facehuggershield-0.1.6-py3-none-any.whl
- Upload date:
- Size: 19.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4082f2614c41a1b6d7ebed8d91b34738f7bd35b874b26ab162c7baaf4e8ef6c1 |
|
MD5 | 8cc98b1a0a7312715f012766ffb038e5 |
|
BLAKE2b-256 | 272b859eb6ec01d2aa5c61c8321f3a6d0d365f481be3e8a1b7d10cc6109d964a |