File size: 681 Bytes
d557d77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""Hugging Face Spaces entry point for CodeRAG.

This file is used by Hugging Face Spaces to launch the Gradio demo.
It's configured to work without GPU (embeddings on CPU, LLM via Groq).
"""

import os

# Configure for HF Spaces environment
os.environ.setdefault("MODEL_LLM_PROVIDER", "groq")
os.environ.setdefault("MODEL_EMBEDDING_DEVICE", "cpu")

# Use HF Spaces secrets for API key
if "GROQ_API_KEY" in os.environ and "MODEL_LLM_API_KEY" not in os.environ:
    os.environ["MODEL_LLM_API_KEY"] = os.environ["GROQ_API_KEY"]

# Import and launch the Gradio app
from coderag.ui.app import create_gradio_app

demo = create_gradio_app()

if __name__ == "__main__":
    demo.launch()