Skip to content

Commit 70e8587

Browse files
committed
fix llm query in image patch
1 parent b4a07e1 commit 70e8587

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

hydra_vl4ai/execution/image_patch.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import tensorneko_util as N
1414

1515
from .toolbox import forward
16-
from ..agent.llm import chatgpt
16+
from ..agent.llm import llm
1717
from ..agent.smb import StateMemoryBank
1818
from ..util.misc import get_hydra_root_folder, load_json
1919
from ..util.config import Config
@@ -558,10 +558,10 @@ def llm_query(query, context=None, long_answer=True, state_memory_bank=None):
558558
prompt_ += f'Could you help me answer the question: {query}.'
559559

560560
if not long_answer:
561-
prompt_ += f'Please provide only a few-word answer. Be very concise, no ranges, no doubt.'
561+
prompt_ += 'Please provide only a few-word answer. Be very concise, no ranges, no doubt.'
562562
try:
563-
return_answer = asyncio.run(chatgpt("gpt-3.5-turbo-1106", prompt_)) or ""
564-
except:
563+
return_answer = asyncio.run(llm(Config.base_config["llm_model"], prompt_)) or ""
564+
except Exception:
565565
return_answer = 'not answer from gpt'
566566

567567
# get global description.

hydra_vl4ai/util/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from tensorneko_util.util import Singleton
33
import tensorneko_util as N
44

5+
56
@Singleton
67
class Config:
78

@@ -22,7 +23,6 @@ def base_config_path(self, value):
2223
self._base_config_path = value
2324
self.base_config = N.read(value)
2425

25-
2626
@property
2727
def dqn_config_path(self):
2828
return self._dqn_config_path

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333

3434
async def main():
35-
with console.status("[bold green]Connect to HYDRA executor...") as status:
35+
with console.status("[bold green]Connect to HYDRA executor..."):
3636
wait_until_loaded(f"http://localhost:{Config.base_config['executor_port']}")
3737

3838
if args.dqn_config is None:

0 commit comments

Comments
 (0)