Skip to content

Commit

Permalink
otter => otter_ai
Browse files Browse the repository at this point in the history
  • Loading branch information
pufanyi committed Sep 4, 2023
1 parent c48eb28 commit 212827d
Show file tree
Hide file tree
Showing 68 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion pipeline/demo/otter_image.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"import sys\n",
"\n",
"sys.path.append(\"../../src\")\n",
"from otter import OtterForConditionalGeneration\n",
"from otter_ai import OtterForConditionalGeneration\n",
"\n",
"model = OtterForConditionalGeneration.from_pretrained(\"luodian/OTTER-9B-LA-InContext\", device_map=\"auto\")\n",
"tokenizer = model.text_tokenizer\n",
Expand Down
2 changes: 1 addition & 1 deletion pipeline/demo/otter_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

sys.path.append("../../src")

from otter import OtterForConditionalGeneration
from otter_ai import OtterForConditionalGeneration


# Disable warnings
Expand Down
2 changes: 1 addition & 1 deletion pipeline/demo/otter_image_incontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

sys.path.append("../../src")

from otter import OtterForConditionalGeneration
from otter_ai import OtterForConditionalGeneration


# Disable warnings
Expand Down
2 changes: 1 addition & 1 deletion pipeline/demo/otter_video.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"import sys\n",
"\n",
"sys.path.append(\"../../src\")\n",
"from otter import OtterForConditionalGeneration\n",
"from otter_ai import OtterForConditionalGeneration\n",
"\n",
"# Disable warnings\n",
"requests.packages.urllib3.disable_warnings()"
Expand Down
2 changes: 1 addition & 1 deletion pipeline/demo/otter_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

sys.path.append("../../src")
# make sure you can properly access the otter folder
from otter import OtterForConditionalGeneration
from otter_ai import OtterForConditionalGeneration

# Disable warnings
requests.packages.urllib3.disable_warnings()
Expand Down
2 changes: 1 addition & 1 deletion pipeline/eval/models/otter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pipeline.eval.eval_model import BaseEvalModel
from contextlib import suppress
from pipeline.eval.models.utils import unwrap_model
from otter import OtterForConditionalGeneration
from otter_ai import OtterForConditionalGeneration
import os

os.environ["TOKENIZERS_PARALLELISM"] = "false"
Expand Down
2 changes: 1 addition & 1 deletion pipeline/serve/model_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
)
from huggingface_hub import hf_hub_download
import transformers
from otter import OtterForConditionalGeneration
from otter_ai import OtterForConditionalGeneration
from flamingo import FlamingoForConditionalGeneration

GB = 1 << 30
Expand Down
4 changes: 2 additions & 2 deletions pipeline/train/instruction_following.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

import wandb

from otter import OtterForConditionalGeneration
from otter import FlamingoForConditionalGeneration
from otter_ai import OtterForConditionalGeneration
from otter_ai import FlamingoForConditionalGeneration
from pipeline.train.data import get_data
from pipeline.train.distributed import world_info_from_env
from pipeline.train.train_utils import AverageMeter, get_checkpoint, get_image_attention_mask
Expand Down
4 changes: 2 additions & 2 deletions pipeline/train/pretraining.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
)

import wandb
from otter import FlamingoForConditionalGeneration
from otter import OtterForConditionalGeneration
from otter_ai import FlamingoForConditionalGeneration
from otter_ai import OtterForConditionalGeneration
from pipeline.train.data import get_data
from pipeline.train.distributed import world_info_from_env
from pipeline.train.train_utils import AverageMeter, get_checkpoint
Expand Down
4 changes: 2 additions & 2 deletions pipeline/train/pretraining_cc3m.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
get_linear_schedule_with_warmup,
)
import wandb
from otter import FlamingoForConditionalGeneration
from otter import OtterForConditionalGeneration
from otter_ai import FlamingoForConditionalGeneration
from otter_ai import OtterForConditionalGeneration
from pipeline.train.data import get_data
from pipeline.train.distributed import world_info_from_env
from pipeline.train.train_utils import AverageMeter, get_checkpoint
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@

setup(
name="otter-ai",
version="0.0.0-alpha",
version="0.0.0-alpha-2",
packages=find_packages(where="src"),
package_dir={"": "src"},
install_requires=requirements,
# package_data={
# "otter": ["resources/**/*"],
# },
# include_package_data=True,
author="Bo Li, Yuanhan Zhang, Liangyu Chen, Jinghao Wang, Fanyi Pu, Jingkang Yang, Chunyuan Li, Ziwei Liu",
author_email="[email protected], [email protected], [email protected], [email protected], [email protected], chunyl@microsoft.com, [email protected]",
author="Otter Team",
author_email="drluodian@gmail.com",
description="Otter: A Multi-Modal Model with In-Context Instruction Tuning",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from transformers import PreTrainedModel
from transformers.modeling_outputs import CausalLMOutputWithPast

from otter.models.flamingo.mpt.custom_embedding import SharedEmbedding
from otter_ai.models.flamingo.mpt.custom_embedding import SharedEmbedding

from .attention import attn_bias as module_attn_bias
from .attention import attn_bias_shape as module_attn_bias_shape
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from transformers.models.auto import CONFIG_MAPPING
from transformers.models.clip import CLIPVisionConfig

from otter.models.flamingo.falcon.configuration_RW import RWConfig
from otter.models.flamingo.mpt.configuration_mpt import MPTConfig
from otter.models.flamingo.mpt_redpajama.configuration_mosaic_gpt import MosaicGPTConfig
from otter_ai.models.flamingo.falcon.configuration_RW import RWConfig
from otter_ai.models.flamingo.mpt.configuration_mpt import MPTConfig
from otter_ai.models.flamingo.mpt_redpajama.configuration_mosaic_gpt import MosaicGPTConfig

logger = logging.get_logger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# You can use it in parent folder by running: python -m models.otter.converting_flamingo_to_otter --checkpoint_path <path_to_flamingo_checkpoint> --save_path <path_to_save_otter_checkpoint>
import argparse
import torch
from otter.models.otter.modeling_otter import OtterForConditionalGeneration
from otter.models.flamingo.modeling_flamingo import FlamingoForConditionalGeneration
from otter_ai.models.otter.modeling_otter import OtterForConditionalGeneration
from otter_ai.models.flamingo.modeling_flamingo import FlamingoForConditionalGeneration

# Define argument parser
parser = argparse.ArgumentParser(description="Load a model with specified precision and save it to a specified path.")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import argparse
import torch
from otter.models.otter.modeling_otter import OtterForConditionalGeneration
from otter_ai.models.otter.modeling_otter import OtterForConditionalGeneration

# Define argument parser
parser = argparse.ArgumentParser(description="Load a model with specified precision and save it to a specified path.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
import torch.nn as nn
from transformers import CLIPVisionModel, LlamaForCausalLM, LlamaTokenizer

from otter.models.otter.modeling_otter import (
from otter_ai.models.otter.modeling_otter import (
OtterPreTrainedModel,
OtterLMMixin,
extend_instance,
_infer_decoder_layers_attr_name,
OtterPerceiverResampler,
)

from otter.models.otter.configuration_otter import OtterConfig
from otter_ai.models.otter.configuration_otter import OtterConfig


class OtterModel(OtterPreTrainedModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

from .configuration_otter import OtterConfig

from otter.models.flamingo.falcon.modelling_RW import RWForCausalLM
from otter.models.flamingo.mpt.modeling_mpt import MPTForCausalLM
from otter.models.flamingo.mpt_redpajama.mosaic_gpt import MosaicGPT
from otter_ai.models.flamingo.falcon.modelling_RW import RWForCausalLM
from otter_ai.models.flamingo.mpt.modeling_mpt import MPTForCausalLM
from otter_ai.models.flamingo.mpt_redpajama.mosaic_gpt import MosaicGPT

from transformers.models.auto import AutoModel, AutoModelForCausalLM, AutoTokenizer
from peft import get_peft_model, LoraConfig, TaskType
Expand Down
2 changes: 1 addition & 1 deletion unittest/test_mmc4_dataset.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest
from unittest.mock import Mock
from otter.pipeline.mimicit_utils.mmc4_dataset import get_mmc4_dataset
from otter_ai.pipeline.mimicit_utils.mmc4_dataset import get_mmc4_dataset


class TestGetMMC4Dataset(unittest.TestCase):
Expand Down

0 comments on commit 212827d

Please sign in to comment.