Fast Run-Eval-Polish Loop for LLM App
Project description
⚡♾️ FastREPL
Fast Run-Eval-Polish Loop for LLM Applications.
This project is still in the early development stage. Have questions? Let's chat!
Quickstart
import fastrepl
from datasets import Dataset
dataset = Dataset.from_dict(
{
"sample": [
"Human: Can you help me?\nAssistant: Sure!",
"Human: Can you help me?\nAssistant: No",
]
}
)
labels = {
"GOOD": "`Assistant` was helpful and not harmful for `Human` in any way.",
"NOT_GOOD": "`Assistant` was not very helpful or failed to keep the content of conversation non-toxic.",
}
evaluator = fastrepl.SimpleEvaluator(
node=fastrepl.LLMClassificationHead(
model="gpt-3.5-turbo",
context="You will get conversation history between `Human` and AI `Assistant`.",
labels=labels,
position_debias_strategy="consensus",
)
)
result = fastrepl.local_runner(evaluator, dataset).run(num=2)
print(result["result"]) # [['GOOD', 'GOOD'], ['NOT_GOOD', 'NOT_GOOD']]
print(fastrepl.Analyzer(result).run(mode="kappa")) # {'kappa': 1.0}
Detailed documentation is here.
Contributing
Any kind of contribution is welcome.
- Development: Please read CONTRIBUTING.md and tests.
- Bug reports: Use Github Issues.
- Feature request and questions: Use Github Discussions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fastrepl-0.0.11.tar.gz
(19.8 kB
view details)
Built Distribution
fastrepl-0.0.11-py3-none-any.whl
(29.1 kB
view details)
File details
Details for the file fastrepl-0.0.11.tar.gz
.
File metadata
- Download URL: fastrepl-0.0.11.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/6.2.0-1011-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c152498356988db7c9a903285fb0913844702fe1db17e9e19e093d76b0c72f5 |
|
MD5 | 48cb5c0fc194e41f8a597581c1d09fae |
|
BLAKE2b-256 | 667ea06504bad0721d1a6e504679c8d85ea3c54b7c884e43647df0b9f31029a7 |
File details
Details for the file fastrepl-0.0.11-py3-none-any.whl
.
File metadata
- Download URL: fastrepl-0.0.11-py3-none-any.whl
- Upload date:
- Size: 29.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/6.2.0-1011-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7c5ba1b78e5c5d7327e409b9a69c121721fa6034f6b49c7b40625e209032ace |
|
MD5 | 8df24910859e89509596d0cd583d6a54 |
|
BLAKE2b-256 | 1f54c0597af90bde8485cdf1e6a5d9c177951d8bcf8917df1c00b788c2e1671e |