prabaerode commited on
Commit
eecd090
·
verified ·
1 Parent(s): c9d8014
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -18,13 +18,13 @@ class CareerNavigator:
18
  self.title = title
19
 
20
  @staticmethod
21
- def model():
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