semvec/pypi-packages huggingface dataset:
blade2blade 0.0.1
Adversarial Training and SFT for Bot Safety Models

# Blade2Blade
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/LAION-AI/blade2blade/ci.yml?branch=main)
![GitHub](https://img.shields.io/github/license/LAION-AI/blade2blade)
![GitHub Repo stars](https://img.shields.io/github/stars/LAION-AI/blade2blade?style=social)

***Evil Sharpens Good.***

Developed By: The LAION-AI Safety Team

|**[Quick Start](#quick-start-fire)** | **[Installation](#installation)** | **[More about blade2blade](#what-is-blade2blade)** |


### Quick Start :fire:

```python
from blade2blade import Blade2Blade

blade = Blade2Blade("shahules786/blade2blade-t5-base")
prompt = "|prompter| I'm here to test your blade|endoftext|"
blade.predict(prompt)
```

### Installation
- With Pypi
```bash
pip install blade2blade
```
- From source
```
git clone https://github.com/LAION-AI/blade2blade.git
cd blade2blade
pip install -e .
```
### What is Blade2Blade?

Blade2Blade is a system that performs fully automated redteaming and blueteaming on any chat, or classifcation model. By using RL, we tune an adversarial user prompter to attack other models and create user prompts that promote dangerous responses from the attacked model. The attacked model is then optimized against the adversarial user prompter to preform automated blueteaming.

Below shows an example of a Blade2Blade type system that attacks GoodT5 (the blueteam model). GoodT5 is a model that is designed to predict Rules of Thumb and safety labels. EvilT5 is a model designed to predict user prompts from the Rules of Thumb and safety labels given to it.
![image](https://github.com/LAION-AI/blade2blade/blob/b01ff1b594c8f9661bdc3365e1e8d3530e7287f2/images/Blade2Blade.png)

#### What is redteaming and blueteaming?

Both red teams and blue teams strive to increase security in a system, but they go about it in different ways. A red team simulates an attacker by looking for weaknesses and trying to get past a system's defences. When an incident occurs, a blue team answers and defends against attacks.

#### What is the final goal of Blade2Blade?

We want to make an easy to use package that will add automated redteaming and blueteaming to any existing training loop. By bringing down the requirements for redteaming and blueteaming we hope that companies and individuals will strive to include this in their systems and create safer LLMs.
liblip 0.91
Library for multivariate scattered data interpolation

# liblip    
Liblip is a library for multivariate scattered data interpolation<br>
The Lipschitz interpolant possesses a number of desirable features, such as continuous dependence on the data, preservation of Lipschitz properties and of the range of the data, uniform approximation and best error bounds. On the practical side, construction and evaluation of the interpolant is com- putationally stable. There is no accumulation of errors with the size of the data set and dimension.<br>
In addition to the Lipschitz constant, the user can provide information about other properties of f, such as monotonicity with respect to any subset of variables, upper and lower bounds (not necessarily constant bounds). If the data are given with errors, then it can be smoothened to satisfy the required properties. The Lipschitz constant, if unknown, can be estimated from the data using sample splitting and cross-validation techniques. The library also provides methods for approximation of locally Lipschitz functions.<br>
There are two alternative ways to compute the interpolant: fast and explicit.<br>
The fast method involves a preprocessing step after which the speed of evaluation is proportional to the logarithm of the size of the data set.<br>
The second alternative is to use the explicit evaluation method, which does not require any preprocessing. We recommend this method for most applications, as it provides more flexibility with smoothing and incorporating other properties of f.<br>
## Documentation
[User Manual](http://gbfiles.epizy.com/liblip2.pdf)

## Installation
To install type:
```python
$ pip install liblip
```
## Usage of the library 

```python
import liblip as ll
```
Follow these steps in your Python code to use the library:<br>
- Initialize resources<br>
- Use library function(s)<br>
- Free resources<br>
### Example how to initialize resources
```python
dim = 3<br>
npts = 1500<br>
x, XData, YData = ll.init( dim, npts)<br>
```

### Example how to free resources
```python
ll.free()<br>
```

### Usage of library functions
To use a library function follow these steps:
1. Initialize input arrays.
2. Initialize input parameters.
3. Call liblip function.
4. Evaluate output parameters. 
### Example
```python
import liblip as ll

dim = 3
npts = 1500
x, XData, YData = ll.init( dim, npts)

# to be continued 

ll.free()
```

### Parameters
#### Input parameters:
See input parameter list in user manual
#### Output parameters:
See output parameter list in user manual

### Test
To unit test type:
```python
$ test/test_procedural.py
```