-
Install dependencies:
pip install -r requirements.txt -
Create a
.envfile and add your Hugging Face API key:HF_API_KEY=your_huggingface_api_key_here -
Start the backend:
python app.pyThe backend will run locally on http://localhost:5000/generate
- Place
index.html,style.css, andscript.jsin the same folder. - Open
index.htmlin your browser. - Make sure your backend is running and accessible at
http://localhost:5000.
- Enter a prompt and click "Generate".
- The generated text will appear below.
- The API key in
.envis secret – never upload.envto GitHub. - For public hosting, update the URL in
script.jsif the backend is not localhost.