Skip to content

Commit 4e88c74

Browse files
author
zhang_lu
authored
Merge pull request #185 from kyusonglee/feature/v0.2.1/lite_version
put transformers under __init__ and make consistent start function for cli
2 parents d3e4b91 + 41a5f3f commit 4e88c74

File tree

5 files changed

+4
-128
lines changed

5 files changed

+4
-128
lines changed

examples/cot/run_lite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ def _run(self, query, *args, **kwargs):
6767
# Initialize and start app client with workflow configuration
6868
config_path = CURRENT_PATH.joinpath('configs')
6969
cli_client = DefaultClient(interactor=workflow, config_path=config_path, workers=[SimpleInput()])
70-
cli_client.start_interaction()
70+
cli_client.start_interactor()
7171

examples/general_dnc/run_lite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ def _run(self, query, *args, **kwargs):
5151
# Initialize and start app client with workflow configuration
5252
config_path = CURRENT_PATH.joinpath('configs')
5353
cli_client = DefaultClient(interactor=workflow, config_path=config_path, workers=[SimpleInput()])
54-
cli_client.start_interaction()
54+
cli_client.start_interactor()
5555
#cli_client.start_processor_with_input({"query":"what is the price of iphone?"})
5656

omagent-core/src/omagent_core/models/llms/qwen2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from datetime import datetime
33
from typing import Any, Dict, List
44

5-
from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig, pipeline
65
from pydantic import Field
76
from .schemas import Content, Message
87
from ...utils.registry import registry
@@ -32,6 +31,7 @@ class Qwen2LLM(BaseLLM):
3231

3332
def __init__(self, **data: Any) -> None:
3433
super().__init__(**data)
34+
from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig, pipeline
3535
self.tokenizer = AutoTokenizer.from_pretrained(self.model_name)
3636
self.model = AutoModelForCausalLM.from_pretrained(self.model_name).to(self.device)
3737

omagent-core/src/omagent_core/models/llms/qwen2_vl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from datetime import datetime
33
from typing import Any, Dict, List
44

5-
from transformers import AutoTokenizer, AutoProcessor, Qwen2VLForConditionalGeneration
65
from pydantic import Field
76
from .schemas import Content, Message
87
from ...utils.registry import registry
@@ -31,6 +30,7 @@ class Qwen2_VL(BaseLLM):
3130

3231
def __init__(self, **data: Any) -> None:
3332
super().__init__(**data)
33+
from transformers import AutoTokenizer, AutoProcessor, Qwen2VLForConditionalGeneration
3434
self.processor = AutoProcessor.from_pretrained(self.model_name,min_pixels=256 * 28 * 28, max_pixels=512 * 28 * 28)
3535
self.model = Qwen2VLForConditionalGeneration.from_pretrained(self.model_name, torch_dtype="auto", device_map="auto").to(self.device)
3636

omagent-core/src/omagent_core/models/llms/qwen_vl.py

Lines changed: 0 additions & 124 deletions
This file was deleted.

0 commit comments

Comments
 (0)