semvec/pypi-packages huggingface dataset:
explainable-attention 0.0.2
Implementation of various tools for multi-head attention explainability from transformers.
Requires Python: >=3.8

# explainable-attention

Implementation of various tools for multi-head attention explainability from transformers.

## Self-Attention Attribution

[Hao, Yaru, et al. "Self-attention attribution: Interpreting information interactions inside transformer." Proceedings of the AAAI Conference on Artificial Intelligence. Vol. 35. No. 14. 2021.](https://arxiv.org/abs/2004.11207)

```py
from explainable_attention.self_attention_attribution import compute

...

def objective(batch):
    x, y = batch
    y = model(x)
    loss = loss_fn(x, y)
    return loss

attribution = saa.compute(
    model.transformer_encoder.layers,
    objective,
    batch,
    integration_steps=20)
```
beets-mpd-utils 0.3.5
Utilities for MPD integration with Beets
Requires Python: >=3.12

# beets-mpd-utils

Some [beets](https://beets.io/) plugins to interface with [Music Player Daemon](https://www.musicpd.org/).

- [MPD Tracker](#mpd-tracker): Track song plays/skips on MPD.
- [MPD DJ](#mpd-dj): Auto-add songs/albums to your MPD queue.

## Installation

Install the plugin.

```bash
pip install beets-mpd-utils
```

Enable the plugin by adding it the `plugins` option in your beets config.

```yaml
plugins: mpd_tracker, mpd_dj
```

## Provided Plugins

### MPD Tracker

The `mpd_tracker` plugin tracks song plays and skips on MPD and records them in the following flexible attributes:

- Song
  - `play_count`: The number of times the song has been played.
  - `last_played`: When the `play_count` was last updated.
  - `skip_count`: The number of times the song has beed skipped.
- Album
  - `last_played`: Only written once every song in the album has been played. Defined as the oldest `last_played` value for the songs in the album.

#### Usage

Once enabled, start the tracker by typing:

```bash
beet tracker
```

#### Configuration

To configure, make a `mpd_tracker` section in your beets config file. Songs will be considered played/skipped if either of the time/percentage thresholds are met.

The available options are:

- **play_time**: The amount of seconds played after which the song will be considered "played". Default: `240`.
- **play_percent**: The percentage of the song that needs to be played before being considered "played". Expects a value between `0` and `1`, default: `0.5`.
- **skip_time**: The amount of seconds played before which the song will be considered "skipped". Default: `20`.
- **skip_percent**: The percentage of the song that needs to be played before which the song will be considered "skipped". Expects a value between `0` and `1`, default: `0.0`.

### MPD DJ

The `mpd_dj` plugin randomly adds items to the MPD queue. Note that activating this plugin will turn off random mode in MPD, as it needs to know what songs are upcoming in the queue.

#### Usage

Once enabled, start the tracker by typing:

```bash
beet dj
```

By default, the plugin will work to maintain 20 upcoming songs, selected randomly from the library. These defaults can be changed using command-line options.

- `--number=ITEMS`, `-n ITEMS`: The plugin will maintain the specified number of items in the upcoming queue.
- `--album`, `-a`: The plugin will queue albums instead of songs.

In addition, you can enter a [query](https://beets.readthedocs.io/en/stable/reference/query.html) to specify what will be added to the queue.

```bash
# maintain 5 albums in the queue, pulling randomly from albums released in 2022
beet dj -n 5 --album year:2022
```
cpfr-gadb 1.0.0
A small tool that crawls a directory for files matching certain wildcards and maintaining a CSV file with all of the files.
Requires Python: >=3.7
Keywords: Game Asset, Asset, Game Asset DB, CSV

# Game Asset DB (GADB)

The game asset DB script crawls your asset directory for files you specify via wildcard patterns
and writes the list into a CSV file. You can also specify columns you wish to add for metadata.
This way, you can easily track metadata for your assets (for example where you downloaded the asset,
who the author is and what the license terms are).
It is recommended to store the csv file under version control (such as git) to track changes to your assets
and to run the script frequently. You can then open it up in your favorite spreadsheet application and
manage the metadata for your assets or create exports for credits, license audits etc.

The script uses a yaml config file (usually 'gadb.yml', but it can be changed using the '-c' command line option).
A sample config file looks like the following:

gadb.yml
```
db: gadb.csv
delimiter: ","
wildcards:
- assets/**/*.xcf
- assets/**/*.ogg
columns:
- URL
- Description
- Author
- Date
- License
```

In the example, the CSV database file is specified as 'gadb.csv'.
The delimiter for the CSV im- and export is specified as ',' (which is important for languages where the comma is used for number formatting)
The wildcards option specifies which files are being crawled
And the columns list specifies which metadata columns should be used in the CSV.

You can either copy the `gadb/__init__.py` file as `gadb.py` to your directory and run it like this:

    python gadb.py

or

    python gadb.py -c myConfigFile.yml

if you want to use a custom config file name.
The script then tries to read any old gadb.csv file, list the current files and merge the data from the old file into the new list of files.

The other way would be to install `cpfr-gadb` via PIP, so you can just run it as

    gadb

or

    gadb -c myConfigFile.yml