A library for distilling models from prompts.
Project description
Prompt2Model - Generate Deployable Models from Instructions
Prompt2Model
is a system that takes a natural
language task description (like the prompts used for
LLMs such as ChatGPT) to train a small
special-purpose model that is conducive for deployment.
Quick Start
Notebook
You can run our demo of Prompt2Model
through a notebook:
Command Line
You can also run through the command line.
pip install prompt2model
Our current Prompt2Model
implementation uses
the OpenAI API. Accordingly, you need to:
-
Sign up on the OpenAI website and obtain an OpenAI API key.
-
Set the environment variable
OPENAI_API_KEY
to your API key by running the following command in your terminal:
export OPENAI_API_KEY=<your key>
You can then run
python prompt2model_demo.py
to create a small model from a prompt, as shown in the demo video below. This script must be run on a device with an internet connection to access the OpenAI API. For best results, run this script on a device with a GPU for training your model.
Demo
https://github.com/neulab/prompt2model/assets/2577384/8d73394b-3028-4a0b-bdc3-c127082868f2
Tips and Examples to Write a Good Prompt
You can see the tips and examples to write a good prompt in prompt_examples.
Components
The prompt2model
package is composed
of several components, each designed
to fulfill a specific purpose. To gain
a comprehensive understanding of how to
utilize each component effectively,
please consult the readme.md
file
situated in the directory of the respective
component. These files can be found at
./prompt2model/<component>/readme.md
.
They provide detailed information and
instructions on customizing and maximizing
the functionality of each
component within the package.
Contribution
If you're interested in contributing to the prompt2model
project, please
- refer to CONTRIBUTING.md
- open an issue or submit a PR
- join us on discord
- or reach out to @vijaytarian and @Chenan3_Zhao on Twitter
Cite
We have written a paper describing Prompt2Model in detail.
If you use Prompt2Model in your research, please cite our paper:
@misc{prompt2model,
title={Prompt2Model: Generating Deployable Models from Natural Language Instructions},
author={Vijay Viswanathan and Chenyang Zhao and Amanda Bertsch and Tongshuang Wu and Graham Neubig},
year={2023},
eprint={2308.12261},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for prompt2model-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f17df501db054f6c4b8a4ebe78a41ce4012dacfc9a200bfc07ce48703f32fc9 |
|
MD5 | 73f70e389022d639e076111cc9c4c1c9 |
|
BLAKE2b-256 | 07179b451349ae0994b99faf41da31270731fa212007cc9d983ad09f5927a2c2 |