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.
Make sure you have the following installed:
pip
for managing Python packagesvenv
or conda
)Clone the repository:
git clone https://github.com/Xer0bit/BookWriter-Lamma3.1-OPENAI.git cd BookWriter-Lamma3.1-OPENAI
Create a virtual environment:
python -m venv venv
Activate the virtual environment:
source venv/bin/activate
venv\Scripts\activate
Install the required packages:
pip install -r requirements.txt
Get your API key from OpenAI.
Create a .env
file in the root directory and add the following:
OPENAI_API_KEY=your_openai_api_key_here
The application will automatically use GPT for text generation once the API key is set in the .env
file.
Download the LLaMA model from here.
Create the following directory structure inside the cloned repository:
mkdir -p meta-llama/Meta-Llama-3-8B-Instruct/original
Place the downloaded model files into the meta-llama/Meta-Llama-3-8B-Instruct/original
folder.
The application will automatically use the local LLaMA model if no OPENAI_API_KEY is found in the .env
file.
To run the application, simply execute the app.py
file:
python app.py
There are no datasets linked
There are no datasets linked