Spaces:
Paused
Paused
alessandro trinca tornidor
commited on
Commit
·
f7d0956
1
Parent(s):
c5dcce1
[refactor] code cleaning
Browse files- model/LISA.py +1 -6
- utils/app_helpers.py +1 -2
model/LISA.py
CHANGED
@@ -3,13 +3,8 @@ from typing import List
|
|
3 |
import torch
|
4 |
import torch.nn as nn
|
5 |
import torch.nn.functional as F
|
6 |
-
from transformers import BitsAndBytesConfig, CLIPVisionModel
|
7 |
|
8 |
-
from
|
9 |
-
DEFAULT_IMAGE_PATCH_TOKEN)
|
10 |
-
|
11 |
-
from .llava.model.language_model.llava_llama import (LlavaLlamaForCausalLM,
|
12 |
-
LlavaLlamaModel)
|
13 |
from .segment_anything import build_sam_vit_h
|
14 |
|
15 |
|
|
|
3 |
import torch
|
4 |
import torch.nn as nn
|
5 |
import torch.nn.functional as F
|
|
|
6 |
|
7 |
+
from .llava.model.language_model.llava_llama import (LlavaLlamaForCausalLM, LlavaLlamaModel)
|
|
|
|
|
|
|
|
|
8 |
from .segment_anything import build_sam_vit_h
|
9 |
|
10 |
|
utils/app_helpers.py
CHANGED
@@ -220,8 +220,7 @@ def get_inference_model_by_args(args_to_parse):
|
|
220 |
conv = conversation_lib.conv_templates[args_to_parse.conv_type].copy()
|
221 |
conv.messages = []
|
222 |
|
223 |
-
prompt = input_str
|
224 |
-
prompt = utils.DEFAULT_IMAGE_TOKEN + "\n" + prompt
|
225 |
if args_to_parse.use_mm_start_end:
|
226 |
replace_token = (
|
227 |
utils.DEFAULT_IM_START_TOKEN + utils.DEFAULT_IMAGE_TOKEN + utils.DEFAULT_IM_END_TOKEN
|
|
|
220 |
conv = conversation_lib.conv_templates[args_to_parse.conv_type].copy()
|
221 |
conv.messages = []
|
222 |
|
223 |
+
prompt = utils.DEFAULT_IMAGE_TOKEN + "\n" + input_str
|
|
|
224 |
if args_to_parse.use_mm_start_end:
|
225 |
replace_token = (
|
226 |
utils.DEFAULT_IM_START_TOKEN + utils.DEFAULT_IMAGE_TOKEN + utils.DEFAULT_IM_END_TOKEN
|