Giter VIP home page Giter VIP logo

oobabooga-webui-token-blocker's Introduction

Token Blocker (Oobabooga WebUI Extension)

This is a extension, which dynamically loads and applys token block lists specific to each model.

Usage

  1. Create a file with the same name as the model to which it should be applied and save it under /block-lists.
  2. Start the WebUi with the extension activated (--extensions token-blocker)

The block list will be automatically applied, when a model with the same name is used for inference.

create-blocklist.py

The create-blocklist.py script creates a blocklist for a specific tokenizer using regex patterns.

$ create-blocklist.py --help
usage: create-blocklist.py [-h] [-r REGEX] [-p {no-chinese}] input out

Token Blocker

positional arguments:
  input                 tokenizer.json file
  out                   Output file for blocked tokens

options:
  -h, --help            show this help message and exit
  -r REGEX, --regex REGEX
                        Regex pattern. If this pattern is matched, the token will be omited from the block list
  -p {no-chinese}, --preset {no-chinese}
                        Select a pattern from the presets

The script already includes the following presets:

  • no-chinese: Creates a blocklist containing all tokens consisting only of chinese symbols

oobabooga-webui-token-blocker's People

Contributors

lufixsch avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.