Spaces:
Sleeping
Sleeping
prabaerode
commited on
123
Browse files
app.py
CHANGED
@@ -18,13 +18,13 @@ class CareerNavigator:
|
|
18 |
self.title = title
|
19 |
|
20 |
@staticmethod
|
21 |
-
def
|
22 |
genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
|
23 |
-
if not asyncio.get_event_loop().is_running():
|
24 |
-
loop = asyncio.new_event_loop()
|
25 |
-
asyncio.set_event_loop(loop)
|
26 |
return ChatGoogleGenerativeAI(model="gemini-pro")
|
27 |
|
|
|
|
|
|
|
28 |
# Initialize CareerNavigator instance
|
29 |
navigator = CareerNavigator()
|
30 |
|
|
|
18 |
self.title = title
|
19 |
|
20 |
@staticmethod
|
21 |
+
async def async_model():
|
22 |
genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
|
|
|
|
|
|
|
23 |
return ChatGoogleGenerativeAI(model="gemini-pro")
|
24 |
|
25 |
+
def model(self):
|
26 |
+
return asyncio.run(self.async_model())
|
27 |
+
|
28 |
# Initialize CareerNavigator instance
|
29 |
navigator = CareerNavigator()
|
30 |
|