historical-ocr / config.py
milwright's picture
Streamline app architecture and improve image processing
aaf0eac
raw
history blame contribute delete
704 Bytes
# config.py
"""
Configuration file for Mistral OCR processing.
Contains API key and other settings.
"""
import os
from dotenv import load_dotenv
# Load environment variables from .env file if it exists
load_dotenv()
# Your Mistral API key - get from Hugging Face secrets or environment variable
# The priority order is:
# 1. HF_MISTRAL_API_KEY environment var (specific to Hugging Face)
# 2. MISTRAL_API_KEY environment var (standard environment variable)
# 3. Empty string (will show warning in app)
MISTRAL_API_KEY = os.environ.get("HF_MISTRAL_API_KEY",
os.environ.get("MISTRAL_API_KEY", ""))
# Model settings
OCR_MODEL = "mistral-ocr-latest"
VISION_MODEL = "pixtral-12b-latest"