Skip to content

Xer0bit/BookWriter-Lamma3.1-OPENAI

Repository files navigation

BookWriter App

This application allows you to generate text using either OpenAI's GPT API or the locally hosted LLaMA model. Follow the instructions below to set up the environment and run the app.

Table of Contents

Requirements

Make sure you have the following installed:

  • Python 3.8 or higher
  • pip for managing Python packages
  • A virtual environment setup tool (venv or conda)
  • Access to the OpenAI API if using GPT, or download the LLaMA model for local usage.

Environment Setup

  1. Clone the repository:

    git clone https://github.com/Xer0bit/BookWriter-Lamma3.1-OPENAI.git
    cd BookWriter-Lamma3.1-OPENAI
    
    
  2. Create a virtual environment:

    python -m venv venv
    
  3. Activate the virtual environment:

    • On macOS/Linux:
      source venv/bin/activate
    • On Windows:
      venv\Scripts\activate
  4. Install the required packages:

    pip install -r requirements.txt
    

Using GPT API

  1. Get your API key from OpenAI.

  2. Create a .env file in the root directory and add the following:

    OPENAI_API_KEY=your_openai_api_key_here
    
  3. The application will automatically use GPT for text generation once the API key is set in the .env file.

Using LLaMA Local Model

  1. Download the LLaMA model from here.

  2. Create the following directory structure inside the cloned repository:

    mkdir -p meta-llama/Meta-Llama-3-8B-Instruct/original
  3. Place the downloaded model files into the meta-llama/Meta-Llama-3-8B-Instruct/original folder.

  4. The application will automatically use the local LLaMA model if no OPENAI_API_KEY is found in the .env file.

Running the Application

To run the application, simply execute the app.py file:

python app.py

App Running Screenshot

About

A revolutionary tool that leverages GPT API or LLaMA 3.1 model to write complete books locally, empowering authors to automate their writing process and boost creativity.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors