Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added moondream and llava. #2154

Closed
wants to merge 5 commits into from
Closed

Conversation

MaanavD
Copy link
Contributor

@MaanavD MaanavD commented Feb 7, 2024

No description provided.

@MaanavD
Copy link
Contributor Author

MaanavD commented Feb 8, 2024

All accuracy and tests are passing on A100 for both llava and moondream.
Please approve workflows when able @xuzhao9 :)

@MaanavD MaanavD marked this pull request as ready for review February 8, 2024 00:04

PATCH_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "patches")

def cache_model(name: str, **kwargs):
import transformers
model_config = eval(class_models[name][2])
model_ctor = getattr(transformers, class_models[name][3])
model_ctor.from_config(model_config, **kwargs)
print(model_config.__class__.__name__)
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these prints for debugging purpose?

Copy link
Contributor

@xuzhao9 xuzhao9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comments

model_ctor.from_config(model_config, **kwargs)
print(model_config.__class__.__name__)
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
if (model_config.__class__.__name__ is "PhiConfig" or "LlavaConfig"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering why we can't use the same code from model_factory.py to determine whether from_config should be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Causes errors w/ runs for other HF models (feel free to test & replicate)

@xuzhao9
Copy link
Contributor

xuzhao9 commented Feb 23, 2024

The models have been added by #2176
Feel free to close this PR.

@MaanavD MaanavD closed this Feb 23, 2024
@MaanavD MaanavD deleted the adding_moondream branch February 23, 2024 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants