Spaces:
Runtime error
Download community_contributions/transcript_summarizer/README.md from SuperLikeLT/4_langgraph: direct link, hf CLI and curl.
- Browser
- Download file 7.54 kB
-
https://huggingface.co/spaces/SuperLikeLT/4_langgraph/resolve/main/community_contributions/transcript_summarizer/README.md
- Command line
-
hf download hf://spaces/SuperLikeLT/4_langgraph/community_contributions/transcript_summarizer/README.md
-
curl -L -o README.md https://huggingface.co/spaces/SuperLikeLT/4_langgraph/resolve/main/community_contributions/transcript_summarizer/README.md
A newer version of the Gradio SDK is available: 6.32.0
Transcript Summarizer using Langgraph and Llama3
A scalable transcript summarizer application built with Python, Ollama API, LLaMA3, LangChain, and Gradio. This application can handle long transcriptions that exceed the context window by chunking and processing them efficiently.
Features
- π Upload .vtt transcript files
- π€ AI-powered summarization using LLaMA3 via Ollama
- π Handles long transcripts with intelligent chunking
- π― Multi-level summarization (chunk-level and final summary)
- π³ Fully containerized with Docker
- π¨ Modern Gradio web interface
- π§ Modular and extensible architecture
- βοΈ Configurable via environment variables
- π Configurable logging levels for debugging
Architecture
transcripter/
βββ src/
β βββ core/
β β βββ __init__.py
β β βββ summarizer.py # Main summarization logic
β β βββ chunker.py # Text chunking strategies
β β βββ vtt_parser.py # VTT file parsing
β βββ services/
β β βββ __init__.py
β β βββ ollama_service.py # Ollama API integration
β β βββ gemini_service.py # Gemini API integration (if needed)
β βββ tests/
β β βββ __init__.py
| |
β βββ ui/
β β βββ __init__.py
β β βββ gradio_app.py # Gradio interface
β βββ utils/
β βββ __init__.py
β βββ config.py # Configuration management
βββ docker/
β βββ Dockerfile
β βββ docker-compose.yml
βββ requirements.txt
βββ main.py
βββ setup.py
Quick Start
Prerequisites
- Python 3.8+ (tested with Python 3.13)
- Docker & Docker Compose (for containerized deployment)
- Ollama running locally with LLaMA3 model
Setup Development Environment
Option 1: Automated Setup (Recommended)
Clone and navigate to the project:
cd c:\Workspace\Personal\transcripterRun the automated setup script:
setup.batThis script will:
- Create a virtual environment
- Install all dependencies
- Check Ollama connectivity
- Provide setup status
Option 2: Manual Setup
Create and activate virtual environment:
python -m venv venv venv\Scripts\activateUpgrade pip:
python -m pip install --upgrade pipInstall dependencies (choose one):
Full Installation (Recommended):
pip install -r requirements.txtMinimal Installation (if you face dependency issues):
pip install -r requirements-minimal.txtEnsure Ollama is running with LLaMA3:
ollama serve ollama pull llama3.1:8bRun the application:
python main.pyAccess the web interface: Open http://localhost:7860 in your browser
Using Docker
Build and run with Docker Compose:
docker-compose -f docker/docker-compose.yml up --buildAccess the application: Open http://localhost:7860 in your browser
Usage
- Upload VTT File: Click on the file upload area and select your .vtt transcript file
- Configure Settings: Adjust chunk size and overlap settings if needed
- Generate Summary: Click "Generate Summary" to process the transcript
- Review Results: View the generated summary and processing statistics
Configuration
The application can be configured through environment variables or by creating a .env file in the project root:
OLLAMA_BASE_URL: Ollama API base URL (default: http://localhost:11434)MODEL_NAME: LLaMA model name (default: llama3.1:8b)CHUNK_SIZE: Maximum tokens per chunk (default: 2000)CHUNK_OVERLAP: Token overlap between chunks (default: 200)GRADIO_PORT: Gradio server port (default: 7860)MAX_CONCURRENT_REQUESTS: Maximum concurrent API requests (default: 3)REQUEST_TIMEOUT: Request timeout in seconds (default: 300)TEMPERATURE: Temperature for text generation (default: 0.3)LOG_LEVEL: Logging level - DEBUG, INFO, WARNING, ERROR, or CRITICAL (default: INFO)
Environment File Setup
Copy the example environment file and modify as needed:
cp .env.example .env
Then edit .env with your preferred settings:
# Example .env configuration
OLLAMA_BASE_URL=http://localhost:11434
MODEL_NAME=llama3.1:8b
CHUNK_SIZE=2000
CHUNK_OVERLAP=200
TEMPERATURE=0.3
GRADIO_PORT=7860
MAX_CONCURRENT_REQUESTS=3
REQUEST_TIMEOUT=300
LOG_LEVEL=INFO
Development
Running Tests
# Run all tests
python -m pytest tests/
# Test specific modules
python -m pytest tests/test_config.py -v # Test configuration loading
python -m pytest tests/test_chunker.py -v # Test text chunking
python -m pytest tests/test_vtt_parser.py -v # Test VTT parsing
python -m pytest tests/test_ollama_service.py -v # Test Ollama integration
Testing Configuration
To verify your environment configuration is working correctly:
python -c "from src.utils.config import Config; c = Config(); print(f'Loaded config: {c.dict()}')"
Code Formatting
black src/
isort src/
Type Checking
mypy src/
Troubleshooting
Common Issues
1. Package Installation Failures
Problem: NumPy or other packages fail to compile on Windows Solution:
- Use the automated setup script (
setup.bat) which handles this automatically - Or try the minimal requirements:
pip install -r requirements-minimal.txt - Ensure you have the latest pip:
python -m pip install --upgrade pip
2. Ollama Connection Issues
Problem: "β Ollama connection: FAILED" Solution:
- Ensure Ollama is running:
ollama serve - Check if the model is available:
ollama list - Pull the model if missing:
ollama pull llama3.1:8b - Verify the URL in your .env file:
OLLAMA_BASE_URL=http://localhost:11434
3. LangGraph Import Errors
Problem: ImportError related to LangGraph Solution:
- Use the exact versions in requirements.txt
- Reinstall:
pip uninstall langgraph langchain -y && pip install -r requirements.txt
4. Gradio Interface Not Loading
Problem: Web interface doesn't load Solution:
- Check if port 7860 is available
- Try a different port: set
GRADIO_PORT=7861in your .env file - Check firewall settings
5. VTT File Processing Errors
Problem: VTT files not parsing correctly Solution:
- Ensure your VTT file follows the WebVTT standard
- Check the sample file in
examples/sample_transcript.vtt - Verify file encoding is UTF-8
6. Debugging and Logging Issues
Problem: Need more detailed logs for troubleshooting Solution:
- Set
LOG_LEVEL=DEBUGin your .env file for detailed logging - Available log levels: DEBUG, INFO, WARNING, ERROR, CRITICAL
- Check application logs for specific error messages
- Use
LOG_LEVEL=ERRORto reduce log verbosity in production
Getting Help
- Check the system health in the web interface
- Review logs for detailed error messages (set LOG_LEVEL=DEBUG for more details)
- Ensure all dependencies are correctly installed
- Verify Ollama is running and accessible
- Test your configuration:
python tests/test_config.py
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
License
MIT License