Skip to main content

No project description provided

Project description

Facehugger Shield

img.png

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

facehuggershield-0.1.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

facehuggershield-0.1.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file facehuggershield-0.1.0.tar.gz.

File metadata

  • Download URL: facehuggershield-0.1.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for facehuggershield-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1feaa4d998ad4e804690f35e082ec9b291ca93fc53c0de8dd1d0f8fc21fb670d
MD5 5c75d9501d9bb3f66bfd2d39996d8ee3
BLAKE2b-256 107318fa07038ce9d46d218a01ef68c3304c5ddadfe8c73916138baa82bb0f38

See more details on using hashes here.

File details

Details for the file facehuggershield-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for facehuggershield-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87ad056ecd0de7d6a6b939439a9f465a9bd1dae9e4a3d3eba4cf04387ebe20bf
MD5 a16702b311e43534f401b0e462e91dac
BLAKE2b-256 d175753cce9a0b6c15943e4aaf4b3850db5736b82b8f3338a74ee3060c2db3e3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page