adhiltortil commited on
Commit
2248ec2
·
1 Parent(s): 6e6fd18

refactor: replace huggingface-hub secret retrieval with environment variable

Browse files
Files changed (2) hide show
  1. app.py +2 -5
  2. requirements.txt +0 -1
app.py CHANGED
@@ -2,13 +2,10 @@ import os
2
  from google import genai
3
  from PIL import Image
4
  import gradio as gr
5
- from huggingface_hub.secrets import get_secret
6
 
7
  def get_api_key():
8
- try:
9
- return get_secret('GEMINI_API_KEY')
10
- except Exception as e:
11
- return None
12
 
13
  def analyze_images(image1, image2):
14
  api_key = get_api_key()
 
2
  from google import genai
3
  from PIL import Image
4
  import gradio as gr
5
+
6
 
7
  def get_api_key():
8
+ return os.environ.get('GEMINI_API_KEY')
 
 
 
9
 
10
  def analyze_images(image1, image2):
11
  api_key = get_api_key()
requirements.txt CHANGED
@@ -1,3 +1,2 @@
1
  google-genai
2
  pillow
3
- huggingface-hub
 
1
  google-genai
2
  pillow