Installation Guide
This guide provides detailed installation instructions for KARMA on different platforms and environments.
Installation Methods
Section titled “Installation Methods”KARMA can be installed through pip and also uv
Installing UV
Run this command
curl -LsSf https://astral.sh/uv/install.sh | sh
Or see UV docs here - https://docs.astral.sh/uv/getting-started/installation/
pip install karma-medeval
uv pip install karma-medeval
Or add to your uv project through
uv add karma-medeval
Verify installation
Section titled “Verify installation”karma --version
Optional Dependencies
Section titled “Optional Dependencies”Audio Support
Section titled “Audio Support”For audio-related datasets and ASR metrics:
pip install "karma-medeval[audio]"
uv pip install "karma-medeval[audio]"
This includes:
jiwer
- Word Error Rate calculationsnum2words
- Number to word conversiontorchaudio
- Audio processing
Install with all dependencies
Section titled “Install with all dependencies”Install the development dependencies through pip
pip install "karma-medeval[all]"
uv pip install "karma-medeval[all]"
Development installation
Section titled “Development installation”Clone the repository
Section titled “Clone the repository”# Clone the repositorygit clone https://github.com/eka-care/KARMA-OpenMedEvalKit.gitcd KARMA-OpenMedEvalKit
Install developer version
Section titled “Install developer version”Then run either of these commands for developer installation
Install the development dependencies through pip
pip install -e .
uv sync
Install with all dependencies
Section titled “Install with all dependencies”Install the development dependencies through pip
pip install -e ".[all]"
uv sync --all-extras
Environment Configuration
Section titled “Environment Configuration”Create a .env
file in your project root:
# Required: HuggingFace token for model downloadsHUGGINGFACE_TOKEN=your_token_here
# Cache configurationKARMA_CACHE_TYPE=duckdbKARMA_CACHE_PATH=./cache.db
# LoggingLOG_LEVEL=INFO
# Optional: OpenAI API key (for certain metrics)OPENAI_API_KEY=your_openai_key
# Optional: DynamoDB configuration (for production)# KARMA_CACHE_TYPE=dynamodb# AWS_REGION=us-east-1# DYNAMODB_TABLE_NAME=karma-cache
HuggingFace Token
Section titled “HuggingFace Token”To access gated models or datasets, set this environment variable with your Huggingface token.
You can see the guide to create tokens here
# Login to HuggingFacehuggingface-cli login
# Or set environment variableexport HUGGINGFACE_TOKEN=your_token_here