Spaces:
Sleeping
Sleeping
Update image_gen.py
Browse files- image_gen.py +2 -2
image_gen.py
CHANGED
|
@@ -31,7 +31,7 @@ import dataframe_image as dfi
|
|
| 31 |
import uuid
|
| 32 |
from PIL import ImageFont, ImageDraw, Image
|
| 33 |
import seaborn as sns
|
| 34 |
-
import google.generativeai as
|
| 35 |
|
| 36 |
|
| 37 |
logging.basicConfig(level=logging.INFO)
|
|
@@ -44,7 +44,7 @@ GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|
|
| 44 |
|
| 45 |
def configure_gemini(api_key):
|
| 46 |
try:
|
| 47 |
-
|
| 48 |
return genai.GenerativeModel('gemini-2.0-flash-thinking-exp')
|
| 49 |
except Exception as e:
|
| 50 |
logger.error(f"Error configuring Gemini: {str(e)}")
|
|
|
|
| 31 |
import uuid
|
| 32 |
from PIL import ImageFont, ImageDraw, Image
|
| 33 |
import seaborn as sns
|
| 34 |
+
import google.generativeai as ggenai
|
| 35 |
|
| 36 |
|
| 37 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 44 |
|
| 45 |
def configure_gemini(api_key):
|
| 46 |
try:
|
| 47 |
+
ggenai.configure(api_key=api_key)
|
| 48 |
return genai.GenerativeModel('gemini-2.0-flash-thinking-exp')
|
| 49 |
except Exception as e:
|
| 50 |
logger.error(f"Error configuring Gemini: {str(e)}")
|