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=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.

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.15.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

fastrepl-0.0.15-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

Details for the file fastrepl-0.0.15.tar.gz.

File metadata

  • Download URL: fastrepl-0.0.15.tar.gz
  • Upload date:
  • Size: 22.4 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

Hashes for fastrepl-0.0.15.tar.gz
Algorithm Hash digest
SHA256 a3060b33067320a63e911f6db01bd38f1919fade65f4e2f93083d735193bdb48
MD5 e9d46f0b2becdc26f3b2d27da4d2060f
BLAKE2b-256 b871289e34d8c78e91c640e95230c31471ee579208aa3ec6c360740fb4cfbe6d

See more details on using hashes here.

File details

Details for the file fastrepl-0.0.15-py3-none-any.whl.

File metadata

  • Download URL: fastrepl-0.0.15-py3-none-any.whl
  • Upload date:
  • Size: 33.2 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

Hashes for fastrepl-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 3645acb1aacbf963d95412307a974cf32cd5e8e3d157704d0d94ea73dd35a4a3
MD5 c0ad9d05adb81decc59a5c7054618be0
BLAKE2b-256 15d7a9384f921341d17175dd2aeeff2a66c405851e44978650347d3b7fd1e109

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