This project provides a simple web app that:
- Lets the user upload a
.txtdocument. - Reads the text content from the file.
- Sends the text to a Hugging Face Llama 2 model (
meta-llama/Llama-2-7b-chat-hf) loaded in 8-bit quantized mode. - Returns a concise summary.
- Python 3.10+
- A machine with enough VRAM/RAM for Llama 2 7B in 8-bit mode
- Access to
meta-llama/Llama-2-7b-chat-hfon Hugging Face - Hugging Face token with model access
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtExport your Hugging Face token:
export HUGGINGFACEHUB_API_TOKEN="your_hf_token"python app.pyThen open: http://localhost:7860
MODEL_NAME(default:meta-llama/Llama-2-7b-chat-hf)MAX_INPUT_CHARS(default:12000)
- Only
.txtuploads are supported. - Very long documents are truncated based on
MAX_INPUT_CHARSbefore summarization.