PromptSource
Toolkit for collecting and applying templates of prompting instances.
WIP
Setup
- Download the repo
- Navigate to root directory of the repo
- 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
- Experimental context: Experiment D
- Prompting interface: design doc
Known Issues
Warning or Error about Darwin on OS X: Try downgrading PyArrow to 3.0.0.