Skip to content

modelscope/PromptScope

Repository files navigation



📝 Introduction

Welcome to PromptScope! In the ever-evolving landscape of artificial intelligence, effective prompt design is crucial for maximizing the performance of language models. PromptScope is a powerful tool designed to streamline this process by providing two essential functionalities: generating demonstrations for in-context learning and optimizing prompts for enhanced efficacy.



PromptScope supports English and Chinese, with OpenAI and Qwen Models for now. Dive in to unlock the full potential of intelligent language generation!

🎉 News

  • : PromptScope is released.

🛠️ Installation:

PromptScope requires Python 3.9 or higher.

Note: This project is currently in active development, it's recommended to install from source.

🚀 Getting Started

We propose that an effective prompt structure consists of three key components: the instruction, which outlines the task description; the demonstration, which provides ideal input-output examples; and the query, which specifies the particular question being posed. This tripartite framework facilitates a clearer understanding of the task at hand, enhances the quality of the model's responses, and ultimately improves overall performance in various applications.



On top of that, we provide:

  • Examples for similar and diversity demonstration generation.
  • Examples for instruction optimization with IPC, OPRO and PromptAgent.
  • Example for an end-to-end prompt optimization workflow on GSM-8K benchmark, with both demonstration augmentation and instruction optimization.

💡 Contribute

Contributions are always encouraged!

We highly recommend install pre-commit hooks in this repo before committing pull requests. These hooks are small house-keeping scripts executed every time you make a git commit, which will take care of the formatting and linting automatically.

pip install -e .
pre-commit install

🏛 License

This framework is licensed under the Apache License (Version 2.0).

💻 Acknowledgement

This project utilizes AutoPrompt, OPRO and PromptAgent libraries, which are licensed under the Apache License, Version 2.0.