Skip to main content

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!

CI Status PyPI Version Open In Colab

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.

Project details


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)

Uploaded Source

Built Distribution

fastrepl-0.0.12-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

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

Hashes for fastrepl-0.0.12.tar.gz
Algorithm Hash digest
SHA256 31f656009a9e9dae951947444238342e7c63f2e726aa94f175468bb5be3e9985
MD5 269f2652ecb7a176316d9a6ade51c1cb
BLAKE2b-256 4bb58ff8b4220697df5dc1bef60a2cc97f823115294491c51ca10b72643a27ab

See more details on using hashes here.

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

Hashes for fastrepl-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 dabd1937c9079605f7d9eefa7dfc7d39a8fae8d57dbd813b7aa4794969a74051
MD5 e691d8fec9a3362100fa0bcb541ffc58
BLAKE2b-256 39c0381d07ad16c2ce0970d80d57f68e746f970f358d3d58f4f088b2cc3209db

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page