This repository was archived by the owner on Sep 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +25
-9
lines changed Expand file tree Collapse file tree 4 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -52,9 +52,6 @@ PYTORCH_NIGHTLY_VERSION=dev20240901
5252# Nightly version for torchvision
5353VISION_NIGHTLY_VERSION=dev20240901
5454
55- # Nightly version for torchtune
56- TUNE_NIGHTLY_VERSION=dev20240928
57-
5855# Uninstall triton, as nightly will depend on pytorch-triton, which is one and the same
5956(
6057 set -x
7572REQUIREMENTS_TO_INSTALL=(
7673 torch==" 2.5.0.${PYTORCH_NIGHTLY_VERSION} "
7774 torchvision==" 0.20.0.${VISION_NIGHTLY_VERSION} "
78- torchtune==" 0.3.0.${TUNE_NIGHTLY_VERSION} "
7975)
8076
8177# Install the requirements. --extra-index-url tells pip to look for package
@@ -91,6 +87,12 @@ REQUIREMENTS_TO_INSTALL=(
9187 $PIP_EXECUTABLE install torchao==" 0.5.0"
9288)
9389
90+ # Rely on the latest tochtune for flamingo support
91+ (
92+ set -x
93+ $PIP_EXECUTABLE install -I git+https://github.com/pytorch/torchtune.git@d002d45e3ec700fa770d9dcc61b02c59e2507bf6
94+ )
95+
9496if [[ -x " $( command -v nvidia-smi) " ]]; then
9597 (
9698 set -x
Original file line number Diff line number Diff line change 3030 SequenceParallel ,
3131)
3232from torch .nn import functional as F
33+
34+ try :
35+ # TODO: remove this after we figure out where in torchtune an `evaluate` module
36+ # is being imported, which is being confused with huggingface's `evaluate``.
37+ import lm_eval # noqa
38+ except Exception :
39+ pass
40+
41+ from torchtune .models .clip import clip_vision_encoder
3342from torchtune .models .llama3_1 ._component_builders import llama3_1 as llama3_1_builder
3443from torchtune .models .llama3_2_vision ._component_builders import (
3544 llama3_2_vision_decoder ,
@@ -223,9 +232,6 @@ def _flamingo(cls):
223232
224233 @classmethod
225234 def _llava (cls ):
226- # TODO: Import locally until we find where in torchtune an `evaluate` module
227- # is being imported, which is being confused with huggingface's `evaluate``.
228- from torchtune .models .clip import clip_vision_encoder
229235 return cls (
230236 model_type = ModelType .Llava ,
231237 modules = {
Original file line number Diff line number Diff line change 33
44# This source code is licensed under the license found in the
55# LICENSE file in the root directory of this source tree.
6+ import argparse
67from typing import Callable , Optional
78
8- import lm_eval
9-
109import torch
1110import torch ._dynamo .config
1211import torch ._inductor .config
1716 BuilderArgs ,
1817 TokenizerArgs ,
1918)
19+ from torchchat .cli .cli import add_arguments_for_verb , arg_init
2020
2121from torchchat .model import Model
2222from torchchat .utils .build_utils import set_precision
2828torch ._inductor .config .triton .cudagraphs = True
2929torch ._dynamo .config .cache_size_limit = 100000
3030
31+ import lm_eval
32+
3133from lm_eval .evaluator import evaluate
3234from lm_eval .models .huggingface import HFLM as eval_wrapper
3335from lm_eval .tasks import get_task_dict
Original file line number Diff line number Diff line change @@ -94,6 +94,12 @@ install_executorch_python_libs() {
9494 bash ./install_requirements.sh --pybind xnnpack
9595 fi
9696
97+ # TODO: figure out the root cause of 'AttributeError: module 'evaluate'
98+ # has no attribute 'utils'' error from evaluate CI jobs and remove
99+ # `import lm_eval` from torchchat.py since it requires a specific version
100+ # of numpy.
101+ pip install numpy==' 1.26.4'
102+
97103 pip3 list
98104 popd
99105}
You can’t perform that action at this time.
0 commit comments