--- title: AIRA v2 β€” Arid-climate Intelligent Risk Assistant emoji: 🌑️ colorFrom: yellow colorTo: red sdk: gradio sdk_version: 4.44 app_file: app.py pinned: false license: mit --- # 🌑️ AIRA v2 β€” Arid-climate Intelligent Risk Assistant **AI-powered voice & vision safety copilot for heat-exposed workers in Qatar.** Built for the **QAI Γ— Hugging Face Hackathon**. Aligned with **Qatar National Vision 2030 β€” Quality of Life**. ## πŸ—οΈ Architecture β€” Full Qwen Stack | Layer | Model | Role | |-------|-------|------| | πŸ‘οΈ **Vision** | `Qwen/Qwen2-VL-2B-Instruct` | Image analysis of job-site heat-stress indicators | | 🧠 **Reasoning** | `Qwen/Qwen3-4B-Instruct` | WBGT calculation, hydration & work-rest planning (Qatar MoPH aligned) | | 🎀 **STT** | `openai/whisper-tiny` | Speech-to-text in Arabic / Hindi / Urdu / English | | πŸ”Š **TTS** | `gTTS` | Spoken safety advice read back to worker | | 🌀️ **Weather** | Open-Meteo API | Live Qatar temperature & humidity | ## πŸ“ Repository Structure ``` AIRA/ β”œβ”€β”€ app.py # Gradio Space: Vision + Qwen3 Reasoning + Voice + WBGT Safety β”œβ”€β”€ train_qwen_vision.py # LoRA fine-tuning script for Qwen2-VL on heat-stress imagery β”œβ”€β”€ requirements.txt # Python dependencies └── README.md # This file (HF Space metadata + docs) ``` ## πŸš€ Deploy to Hugging Face Spaces ### Prerequisites > ⚠️ Gradio Spaces require a **HF Pro subscription** on cpu-basic hardware. > Subscribe at https://huggingface.co/pro (your $100 credits can cover this). ### One-command deploy ```bash # Install HF CLI curl -LsSf https://hf.co/cli/install.sh | bash -s # Login (you must do this yourself) hf auth login # Create + upload the Space (run once Pro is active) hf repos create jonathan4e/aira-v2 --type space --sdk gradio --exist-ok hf upload jonathan4e/aira-v2 --type space app.py requirements.txt README.md --commit-message "Deploy AIRA v2" hf spaces settings jonathan4e/aira-v2 --hardware t4-small hf spaces wait jonathan4e/aira-v2 --timeout 600 ``` **Your Space URL:** `https://huggingface.co/spaces/jonathan4e/aira-v2` ## 🎯 Fine-tune Qwen2-VL on Your Own Dataset ```bash # 1. Create/push a heat-stress image dataset to HF python create_dataset.py --push jonathan4e/aira-heat-stress # 2. Fine-tune Qwen2-VL-2B with LoRA (PEFT) python train_qwen_vision.py \ --dataset jonathan4e/aira-heat-stress \ --output jonathan4e/aira-qwen2vl-heat \ --epochs 1 --batch 2 # 3. Update app.py VISION_MODEL_ID to your fine-tuned model ``` ## 🧠 WBGT Safety Logic (Qatar MoPH Aligned) - **WBGT estimate** from temperature + humidity + solar load - **Risk bands:** Low (<29Β°C), Moderate (29–31Β°C), High (31–33Β°C), Extreme (>33Β°C) - **Output:** hydration (L/hr), work/rest cycle (min work / min rest shade), immediate actions - Multilingual: English, Arabic, Hindi, Urdu ## πŸ“± Demo Features - `gr.Examples` pre-loaded for instant hackathon judging - Mobile-responsive Gradio UI with RTL support for Arabic/Urdu - Voice input β†’ transcription β†’ Qwen3 reasoning β†’ TTS audio output - Image upload β†’ Qwen2-VL heat-stress classification ## πŸ‡ΆπŸ‡¦ Alignment Supports **Qatar National Vision 2030 β€” Quality of Life** by protecting outdoor, logistics, and construction workers from extreme summer heat with free, open-source, mobile-accessible AI. ## πŸ“„ License MIT