Upload FloSmolV
Browse files- modeling_flosmolv.py +4 -4
modeling_flosmolv.py
CHANGED
@@ -11,15 +11,15 @@ class FloSmolV(PreTrainedModel):
|
|
11 |
def __init__(self, config: FloSmolVConfig):
|
12 |
super().__init__(config)
|
13 |
self.florence2_model = AutoModelForCausalLM.from_pretrained(
|
14 |
-
self.config.vision_config
|
15 |
trust_remote_code=True,
|
16 |
).eval().to(self.device)
|
17 |
-
self.florence2_processor = AutoProcessor.from_pretrained(self.config.vision_config
|
18 |
self.smollm_model = AutoModelForCausalLM.from_pretrained(
|
19 |
-
self.config.llm_config
|
20 |
trust_remote_code=True,
|
21 |
).to(self.device)
|
22 |
-
self.smollm_tokenizer = AutoTokenizer.from_pretrained(self.config.llm_config
|
23 |
|
24 |
def forward(self, image, query: str):
|
25 |
## Vision
|
|
|
11 |
def __init__(self, config: FloSmolVConfig):
|
12 |
super().__init__(config)
|
13 |
self.florence2_model = AutoModelForCausalLM.from_pretrained(
|
14 |
+
self.config.vision_config["_name_or_path"],
|
15 |
trust_remote_code=True,
|
16 |
).eval().to(self.device)
|
17 |
+
self.florence2_processor = AutoProcessor.from_pretrained(self.config.vision_config["_name_or_path"], trust_remote_code=True,)
|
18 |
self.smollm_model = AutoModelForCausalLM.from_pretrained(
|
19 |
+
self.config.llm_config["_name_or_path"],
|
20 |
trust_remote_code=True,
|
21 |
).to(self.device)
|
22 |
+
self.smollm_tokenizer = AutoTokenizer.from_pretrained(self.config.llm_config["_name_or_path"], trust_remote_code=True,)
|
23 |
|
24 |
def forward(self, image, query: str):
|
25 |
## Vision
|