Instructions to use OpenGVLab/VideoChat-TPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/VideoChat-TPO with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("OpenGVLab/VideoChat-TPO", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download model_config.py from OpenGVLab/VideoChat-TPO: direct link, hf CLI and curl.
- Browser
- Download file 598 Bytes
-
https://huggingface.co/OpenGVLab/VideoChat-TPO/resolve/main/model_config.py
- Command line
-
hf download hf://OpenGVLab/VideoChat-TPO/model_config.py
-
curl -L -o model_config.py https://huggingface.co/OpenGVLab/VideoChat-TPO/resolve/main/model_config.py
598 Bytes
| import copy | |
| import re, ast | |
| from transformers import AutoConfig, LlamaConfig | |
| from transformers.configuration_utils import PretrainedConfig | |
| from transformers.utils import logging | |
| from easydict import EasyDict as MyEasyDict | |
| from importlib import import_module | |
| import os.path as osp | |
| import argparse | |
| import json | |
| from copy import deepcopy | |
| import sys | |
| class VideoChatEConfig(PretrainedConfig): | |
| model_type = 'VideoChatE' | |
| def __init__( | |
| self, | |
| model_config=None, | |
| **kwargs): | |
| super().__init__(**kwargs) | |
| self.model_config = MyEasyDict(model_config) |