llm-few-shot-gen 0.1.2

Creator: bradpython12

Last updated:

Add to Cart

Description:

llmfewshotgen 0.1.2

LLM Few Shot Gen




[!WARNING]
This library is not maintained anymore. Checkout the new project llm-prompting-gen.

Installation
pip install llm-few-shot-gen

What is LLM Few Shot Generator?
Large language models (LLMs) are emerging as a transformative technology, enabling developers to build applications that they previously could not. However, fine-tune them is not always possible or too expansive. In-context learning like Few Shot learning tries to solve this problem. Based on a few number of examples within the prompt a specific output can be obtained. This llm-few-shot-gen library enables few shot learning in a convenient way.
How can I use it?
The core functionality is the generators module. The class PromptEngineeringGenerator defines all requirements for a LLM to generate text based on prompt engineering techniques. If you want your output to be parsed into an pydantic dataclass checkout the class ParsablePromptEngineeringGenerator.
How to customise the class for my own use case?
The class PromptEngineeringGenerator contains two core parts 1. LLM 2. prompt engineering dataclass. If you want to initialise the generator class for you custom use case, you need to define a prompt engineering JSON file matching the format of llm_few_shot_gen.models.prompt_engineering.PromptElements.
The JSON file can contain the following prompt elements in any combination tailored to your use case:
Role:
The role in which the LLM should respond
Instruction:
The task of the LLM
Context:
Context with relevant information to solve the task
Output Format:
Description how the LLM output format should look like
Few Shot Examples:
Few shot examples with optional introduction
Input:
Target which the LLM should execute the task on. Could be for example a user question, or a text block to summarize.
Showcases

Notebook Showcase: Midjourney Prompt
Notebook Showcase: Keyword Extractor
App: Image Gen AI Prompt Generator

License
llm-few-shot-gen is distributed under the terms of the MIT license.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.