Skip to content

Commit 2037a86

Browse files
committed
Fix gen kwargs image aspect ratio in internvl2
2 parents e6844db + a5c1869 commit 2037a86

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1030
-2778
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ temp
1313
__pycache__
1414
.ipynb_checkpoints
1515
temp
16+
.DS_STORE
1617
# IPython
1718
profile_default/
1819
ipython_config.py

lmms_eval/__main__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
165165
# reset logger
166166
eval_logger.remove()
167167
eval_logger.add(sys.stdout, colorize=True, level=args.verbosity)
168-
# eval_logger.add(sys.stderr, level=args.verbosity)
169168
eval_logger.info(f"Verbosity set to {args.verbosity}")
170169
os.environ["TOKENIZERS_PARALLELISM"] = "false"
171170

lmms_eval/api/samplers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ def get_context(self, doc, num_fewshot):
3737
+ (
3838
str(self.doc_to_target(doc)[0])
3939
if type(self.doc_to_target(doc)) is list
40-
else self.doc_to_target(doc) if (self.config.doc_to_choice is None or type(self.doc_to_target(doc)) is str) else str(self.doc_to_choice(doc)[self.doc_to_target(doc)])
40+
else self.doc_to_target(doc)
41+
if (self.config.doc_to_choice is None or type(self.doc_to_target(doc)) is str)
42+
else str(self.doc_to_choice(doc)[self.doc_to_target(doc)])
4143
)
4244
for doc in selected_docs
4345
]

lmms_eval/evaluator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def evaluate(
325325
# hack: remove image columns to speed avoid loading images and speed up postprocessing
326326
# reason: doc_iterator will actually load image if it's in the doc.
327327
docs = task.test_docs() if task.has_test_docs() else task.validation_docs()
328-
if "d170" not in task_name and "dc100" not in task_name and "dc200" not in task_name and "llava_wilder" not in task_name and "live_bench" not in task_name and "wildvision" not in task_name:
328+
if "d170" not in task_name and "dc100" not in task_name and "dc200" not in task_name and "llava_wilder" not in task_name and "livebench" not in task_name and "wildvision" not in task_name:
329329
remove_cols = []
330330
features = docs.features
331331
# If it is an Image instance or a Sequence of Image instance. Remove it

lmms_eval/models/__init__.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
from loguru import logger
55
import sys
66

7+
import hf_transfer
8+
9+
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
10+
711
logger.remove()
812
logger.add(sys.stdout, level="WARNING")
913

@@ -34,7 +38,6 @@
3438
"tinyllava": "TinyLlava",
3539
"llava_hf": "LlavaHf",
3640
"longva": "LongVA",
37-
"llava_onevision": "Llava_OneVision",
3841
"llava_hf": "LlavaHf",
3942
"longva": "LongVA",
4043
"vila": "VILA",
@@ -44,8 +47,7 @@
4447
try:
4548
exec(f"from .{model_name} import {model_class}")
4649
except ImportError as e:
47-
# logger.warning(f"Failed to import {model_class} from {model_name}: {e}")
48-
pass
50+
logger.warning(f"Failed to import {model_class} from {model_name}: {e}")
4951

5052
if os.environ.get("LMMS_EVAL_PLUGINS", None):
5153
# Allow specifying other packages to import models from
@@ -55,8 +57,4 @@
5557
try:
5658
exec(f"from {plugin}.models.{model_name} import {model_class}")
5759
except ImportError:
58-
pass
59-
60-
import hf_transfer
61-
62-
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
60+
logger.warning(f"Failed to import {model_class} from {model_name}")

0 commit comments

Comments
 (0)