This repository contains code for a Streamlit application that leverages language models for various tasks 📚. The application includes functionalities for basic language generation 💬, creative writing ✍, text summarization 📝, few-shot learning 🎯, and Python code generation 🐍.
The Streamlit application provides an interface for the following tasks:
-
Base Generation 💬: This feature is for standard language generation tasks. Users can provide a prompt, and the application will generate a response based on the input.
-
Creative Writing ✍: This feature allows users to generate creative content, such as stories or poems. Like base generation, it requires a user-provided prompt.
-
Text Summarization 📝: This feature enables users to summarize long blocks of text. It requires a large text input from the user and generates a summarized version of the input.
-
Few-Shot Learning 🎯: This feature is useful for performing few-shot learning. Users can provide a set of examples and a prompt, and the application will generate a response based on the given examples and the prompt.
-
Python Code Generation 🐍: This feature leverages a Python agent for generating Python code based on user prompts.
To use the application, you need to provide your OpenAI API Key and a path to the weights for your GPT model.
For each feature, you can input your prompt or text into the input box and hit 'Enter' 🖱. The application will generate and display the response.
The application requires Python and Streamlit. Other dependencies are included in the requirements.txt
file.
To set up and run the application, follow these steps:
-
Clone this repository to your local machine 🖥.
-
Install the necessary dependencies by running
pip install -r requirements.txt
📦. -
Set up your OpenAI API Key and the path to the GPT model weights 🔑.
-
Run the application using Streamlit with
streamlit run app-comparison.py
🚀.
The main dependencies for this project are:
- Streamlit: Used to build the web application interface.
- Langchain: Used for language generation tasks.
- GPT4AllReference: Mainly used to determine how to install the GPT4All library and references. The documentation was changing frequently, and at the time of coding this was the most up-to-date example of getting it running.