Skip to content

Commit

Permalink
Initialize openai client and replicate client
Browse files Browse the repository at this point in the history
  • Loading branch information
yjg30737 committed Nov 13, 2024
1 parent dd1d8d5 commit dbbf224
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pyqt_openai/mainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
restart_app,
show_message_box_after_change_to_restart,
set_auto_start_windows,
init_llama,
init_llama, set_api_key,
)
from pyqt_openai.widgets.navWidget import NavBar

Expand Down Expand Up @@ -102,7 +102,7 @@ def __initUi(self):
self.__setTrayMenu()
self.__setToolBar()

init_llama()
self.__loadApiKeys()

self.setCentralWidget(self.__mainWidget)
self.resize(*APP_INITIAL_WINDOW_SIZE)
Expand All @@ -112,6 +112,11 @@ def __initUi(self):
self.__customizeParamsContainer
)

def __loadApiKeys(self):
set_api_key('OPENAI_API_KEY', CONFIG_MANAGER.get_general_property('OPENAI_API_KEY'))
set_api_key('REPLICATE_API_KEY', CONFIG_MANAGER.get_general_property('REPLICATE_API_KEY'))
init_llama()

def __setActions(self):
self.__langAction = QAction()

Expand Down

0 comments on commit dbbf224

Please sign in to comment.