Update vlm/vlm.py
Browse files- vlm/vlm.py +2 -6
vlm/vlm.py
CHANGED
@@ -2,12 +2,8 @@ import os
|
|
2 |
from typing import Any
|
3 |
from vlm.vlm_interface import VLMIterface
|
4 |
import google.generativeai as genai
|
5 |
-
from dotenv import load_dotenv
|
6 |
-
|
7 |
-
# Load environment variables from a .env file
|
8 |
-
load_dotenv()
|
9 |
# Fetch Google API key from environment variables
|
10 |
-
|
11 |
NAME = "gemini-1.5-flash"
|
12 |
|
13 |
class VLM(VLMIterface):
|
@@ -22,7 +18,7 @@ class VLM(VLMIterface):
|
|
22 |
"""
|
23 |
super().__init__()
|
24 |
# Configure the generative AI model with the provided API key
|
25 |
-
genai.configure(api_key=
|
26 |
# Initialize the model (Gemini 1.5 Flash) from Google's generative AI
|
27 |
self.vlm = genai.GenerativeModel(NAME)
|
28 |
|
|
|
2 |
from typing import Any
|
3 |
from vlm.vlm_interface import VLMIterface
|
4 |
import google.generativeai as genai
|
|
|
|
|
|
|
|
|
5 |
# Fetch Google API key from environment variables
|
6 |
+
API = os.getenv("GOOGLE_API_KEY")
|
7 |
NAME = "gemini-1.5-flash"
|
8 |
|
9 |
class VLM(VLMIterface):
|
|
|
18 |
"""
|
19 |
super().__init__()
|
20 |
# Configure the generative AI model with the provided API key
|
21 |
+
genai.configure(api_key=API)
|
22 |
# Initialize the model (Gemini 1.5 Flash) from Google's generative AI
|
23 |
self.vlm = genai.GenerativeModel(NAME)
|
24 |
|