Skip to main content

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.


img.png

Upload Python Package


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.3.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

facehuggershield-0.1.3-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: facehuggershield-0.1.3.tar.gz
  • Upload date:
  • Size: 14.1 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.3.tar.gz
Algorithm Hash digest
SHA256 7b8f08d575a1b557e334c83e36939d3fefe5e162844af7545b79a67906598ad3
MD5 dbb261c281dd61c7e337d0443d6316f2
BLAKE2b-256 b73dd64bec3b688bbdc4ac2ad3e636752bfae4ed55e2560b306a1c13e71b929b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for facehuggershield-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 abdd4c40bc2ba535afcc503a30ef57dab3828f29be2d9c39fbdb64542dc8197a
MD5 a39b3e315078aa18435fd10ebfa27aec
BLAKE2b-256 f80186c0f091d26cf8d98e8f6b256c9f6e7f302ee4f1ba6edb28df7e056a8776

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