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=evaluator,
dataset=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.13.tar.gz
(21.7 kB
view details)
Built Distribution
fastrepl-0.0.13-py3-none-any.whl
(32.1 kB
view details)
File details
Details for the file fastrepl-0.0.13.tar.gz
.
File metadata
- Download URL: fastrepl-0.0.13.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/6.2.0-1012-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | acaefc4b0397fdde1438d016600abba30e260dc4117c6878fb4cd8a1871ecfd8 |
|
MD5 | 7849f2e360371e368eed5d8732429fb2 |
|
BLAKE2b-256 | 76933db769bdddded19ca231d09bd421e2f13b2f43069df8c327198b47e367d2 |
File details
Details for the file fastrepl-0.0.13-py3-none-any.whl
.
File metadata
- Download URL: fastrepl-0.0.13-py3-none-any.whl
- Upload date:
- Size: 32.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/6.2.0-1012-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce76d02adda66264ce32e30ae5c535dc49d833f380ff34ea70b7ab678e08687a |
|
MD5 | 789b481bc4e5ea79c2f74a072e756e28 |
|
BLAKE2b-256 | e9765d387ba3047edc1815ce4ddc63adcec9ce0ef70fb0ccfb53085c8cffcc6a |