This project is a web application that uses FastAPI and React to generate text using GPT-2.
- Python 3.12^
- Node.js and npm
- Poetry
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Install the required Python packages using Poetry:
poetry install
-
Activate the virtual environment:
poetry shell
-
Start the FastAPI backend:
uvicorn app:app --reload
-
Navigate to the
ui
directory:cd ui
-
Install the required Node.js packages:
npm install
-
Build the React app:
npm run build cd ..
-
Ensure the backend is running:
uvicorn app:app --reload
-
Access the application:
Open your web browser and go to
http://127.0.0.1:8000/
.
- The React app will be served from the FastAPI backend.
- Enter a prompt and see each new generated text response appear in a new text box under the previous responses, with the results container automatically scrolling to the latest response as it is being typed.