GithubHelp home page GithubHelp logo

ibeltagy / promptsource Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bigscience-workshop/promptsource

0.0 1.0 0.0 597 KB

Toolkit for collecting and applying templates of prompting instances

License: Apache License 2.0

Python 99.10% Makefile 0.90%

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

arnaudstiegler avatar awebson avatar craffel avatar elsanns avatar manandey avatar sbmaruf avatar shanyas10 avatar srush avatar stephenbach avatar tianjianjiang avatar urmish avatar victorsanh 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.