Git Product home page Git Product logo

promptsource's Introduction

PromptSource

Toolkit for collecting and applying templates of prompting instances.

WIP

Setup

  1. Download the repo
  2. Navigate to root directory of the repo
  3. Install requirements with pip install -r requirements.txt

Running

From the root directory of the repo, you can launch the editor with

streamlit run promptsource/promptsource.py

There are 3 modes in the app:

  • Helicopter view: aggregate high level metrics on the current state of the sourcing
  • Prompted dataset viewer: check the templates you wrote or already written on entire dataset
  • Sourcing: write new prompts

Contributing

Join the Hackaprompt and help writing templates!

Contribution guidelines and step-by-step HOW TO are described here.

Writing Templates

A prompt template is expressed in Jinja.

It is rendered using an example from the corresponding Hugging Face datasets library (a dictionary). The separator ||| should appear once to divide the template into prompt and output. Generally, the prompt should provide information on the desired behavior, e.g., text passage and instructions, and the output should be a desired response.

Here's an example for AG News:

{{text}}
Is this a piece of news regarding {{"world politics"}}, {{"sports"}}, {{"business"}}, or {{"science and technology"}}? |||
{{ ["World politics", "Sports", "Business", "Science and technology"][label] }}

For more information, read the Contribution guidelines.

Other documentation

Known Issues

Warning or Error about Darwin on OS X: Try downgrading PyArrow to 3.0.0.

promptsource's People

Contributors

abheesht17 avatar arnaudstiegler avatar arunraja-hub avatar awebson avatar cccntu avatar craffel avatar debajyotidatta avatar drugilsberg avatar elsanns avatar gchhablani avatar hannight avatar harsh4799 avatar jetrunner avatar josrozen avatar manandey avatar nihalnayak avatar nohtow avatar rbawden avatar relaxedplan avatar sbmaruf avatar shanyas10 avatar srush avatar stephenbach avatar tae898 avatar teelinsan avatar thomasw21 avatar trishalaneeraj avatar urmish avatar victorsanh avatar zaidalyafeai avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.