-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add optional model_revision to SentenceTransformer #1645
Conversation
@nreimers any chance this could get reviewed to extend flexibility of fixing the model version to use? |
@nreimers any chance you could take a look at this? Small change, no conflicts. |
@nreimers I would also appreciate this |
+1 |
Hey @nreimers, we have a couple people with the use case for adding this small change and at least one other person wanted it enough they created another PR (#1850). I added revision as the last parameter so it should not break previous workflows that others have used with positional args. Please take a look and consider adding the change, thanks! |
@plynch-chwy I just realised it has been a year since this was open, it seems like it's not happening. Are you using a workaround to handle this? (A fork maybe?) |
@amine-mf yes this PR is my own fork of the repo. At the time I forked this repo and added a line in my requirements.txt file to pip install from my fork instead of pypi. You can add a line like this and pip will install your own fork.
Even though I opened this a year ago... It doesn't look like there are any conflicts still with master, so you should be able to use this change on top of the latest changes to this repo. |
@plynch-chwy That's what I thought, the things is, a fork will need to be maintained and kept up to date. I was hoping there was a different workaround (env variable, static setting....) |
I asked around in the huggingface discord and was informed that the maintainer @nreimers went on to found another company and the development of this repo is effectively dead. @amine-mf well this hasn't had a conflict show up in over a year so it should be hopefully as easy as doing a rebase once and a while to pull in new upstream changes. I am using fixed versions for other libraries I install from pypi, so this kinda works in the same way. I do wish we didn't have to go through this whole ceremony though of updating and I could just point to a pypi version with the chage. |
@nreimers any chance you get to this PR soon? It's been here for a while and it seems that there's a few people waiting/hoping for it. We would all very much appreciate your effort. |
I had a discussion with @nreimers and confirmed someone is taking over to maintain the repo. but the PR hasn't made any progress yet. From the recent commits, I'm guess it is you @tomaarsen ? Could you give this one a look? |
@amine-mf Hello! That's right! I've been going through the open PRs to pick out high priority ones. I'll bump this one up the queue for you.
|
As mentioned in my previous comment, this has been superseded by #2419. The
|
Problem
The current
SentenceTransformer
class doesn't allow initialization with a specific model revision.Related issue: #1373
Solution
This PR adds an optional parameter
model_revision
to theSentenceTransformer
class that gets passed through to thesentence_transformers.util.snapshot_download
call which already allows specifying arevision
today and defaults toNone
as implemented here.