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.12.tar.gz
(20.9 kB
view details)
Built Distribution
fastrepl-0.0.12-py3-none-any.whl
(30.6 kB
view details)
File details
Details for the file fastrepl-0.0.12.tar.gz
.
File metadata
- Download URL: fastrepl-0.0.12.tar.gz
- Upload date:
- Size: 20.9 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 | 31f656009a9e9dae951947444238342e7c63f2e726aa94f175468bb5be3e9985 |
|
MD5 | 269f2652ecb7a176316d9a6ade51c1cb |
|
BLAKE2b-256 | 4bb58ff8b4220697df5dc1bef60a2cc97f823115294491c51ca10b72643a27ab |
File details
Details for the file fastrepl-0.0.12-py3-none-any.whl
.
File metadata
- Download URL: fastrepl-0.0.12-py3-none-any.whl
- Upload date:
- Size: 30.6 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 | dabd1937c9079605f7d9eefa7dfc7d39a8fae8d57dbd813b7aa4794969a74051 |
|
MD5 | e691d8fec9a3362100fa0bcb541ffc58 |
|
BLAKE2b-256 | 39c0381d07ad16c2ce0970d80d57f68e746f970f358d3d58f4f088b2cc3209db |