Skip to content

[CHORE] Remove validation on ef config update for model path #4571

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

Merged
merged 1 commit into from
May 19, 2025

Conversation

jairad26
Copy link
Contributor

@jairad26 jairad26 commented May 19, 2025

Description of changes

Some embedding functions allow the user to pass a path for their embedding function. We should not be validating that the user is trying to update the model path, as that could be too restrictive.

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs section?

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

Please tag your PR title with one of: [ENH | BUG | DOC | TST | BLD | PERF | TYP | CLN | CHORE]. See https://docs.trychroma.com/contributing#contributing-code-and-ideas

@jairad26 jairad26 changed the title [FIX] Remove validation on config update for model path [CHORE] Remove validation on config update for model path May 19, 2025
@jairad26 jairad26 marked this pull request as ready for review May 19, 2025 20:20
@jairad26 jairad26 force-pushed the jai/remove-ef-model-path-validation branch from 258ea35 to d7a22a9 Compare May 19, 2025 20:20
Copy link
Contributor

propel-code-bot bot commented May 19, 2025

This PR removes the validation that previously prevented users from updating the 'model_name' (used as model path) in the configuration of instructor, sentence transformer, and text2vec embedding functions. Now, users can change the model path after initialization, enabling scenarios such as updating the path to a local or upgraded model file.

This summary was automatically generated by @propel-code-bot

@jairad26 jairad26 changed the title [CHORE] Remove validation on config update for model path [CHORE] Remove validation on ef config update for model path May 19, 2025
@HammadB
Copy link
Collaborator

HammadB commented May 19, 2025

What is an example of a valid use here?

Copy link
Collaborator

@HammadB HammadB left a comment

Choose a reason for hiding this comment

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

Would be good to comment a tangible example

@jairad26
Copy link
Contributor Author

came from a need of a user
https://discord.com/channels/1073293645303795742/1373083545936859257/1373083545936859257
this user (from my understanding) may have been testing some models from Sentence Transformers, and created a collection using a model directly from huggingface (sentence-transformers/msmarco-MiniLM-L6-cos-v5). They then downloaded the model locally since they moved behind a firewall, and now need to reference it via path. they would now be able to update the configuration with the new path with this change during collection.modify().

I can see a need where users move the paths of their models around, maybe for cleanup, maybe because they are updating apis from v1 to v2, and so need to update the file path for that. Will add a comment in the code too

@jairad26 jairad26 force-pushed the jai/remove-ef-model-path-validation branch from d7a22a9 to 08a1047 Compare May 19, 2025 20:38
@jairad26 jairad26 enabled auto-merge (squash) May 19, 2025 20:39
@jairad26 jairad26 merged commit d94fb9f into main May 19, 2025
71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants