AyushSankar13 commited on
Commit
aee44a0
·
verified ·
1 Parent(s): 62408a6

Update backend.py

Browse files
Files changed (1) hide show
  1. backend.py +0 -11
backend.py CHANGED
@@ -58,17 +58,6 @@ class AnalyzeRequest(BaseModel):
58
  image_base64: str
59
  prompt: Optional[str] = None
60
 
61
- GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")
62
-
63
- logger.info(f"Environment GEMINI_API_KEY exists: {'GEMINI_API_KEY' in os.environ}")
64
- if GEMINI_API_KEY:
65
- logger.info(f"API key loaded, length: {len(GEMINI_API_KEY)}")
66
- else:
67
- logger.error("No API key found in environment")
68
-
69
- if not GEMINI_API_KEY:
70
- raise RuntimeError("No Gemini API key found. Set GEMINI_API_KEY environment variable in Hugging Face Spaces settings.")
71
-
72
  genai.configure(api_key=GEMINI_API_KEY)
73
 
74
  generation_config = {
 
58
  image_base64: str
59
  prompt: Optional[str] = None
60
 
 
 
 
 
 
 
 
 
 
 
 
61
  genai.configure(api_key=GEMINI_API_KEY)
62
 
63
  generation_config = {