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

[FEATURE] Only require model_id once to save a model #323

Open
HenryL27 opened this issue Oct 20, 2023 · 2 comments
Open

[FEATURE] Only require model_id once to save a model #323

HenryL27 opened this issue Oct 20, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@HenryL27
Copy link

Is your feature request related to a problem?
In order to save an embedding model (which I will then upload to my OS cluster) I need to do the following steps:

model_name = Path(model_id).name
model = SentenceTransformerModel(
    model_id=model_id,
    folder_path=f"/tmp/{model_name}"
)
model.save_as_pt(
    sentences=["dummy sentence"],
    model_id=model_id,
    save_json_folder_path=f"/tmp/{model_name}"
)
mconfig_path = model.make_model_config_json(model.model_id, )
ml_client.register_model(
    model_path=f"/tmp/{model_name}/{model_name}.zip",
    model_config_path=mconfig_path
)

If I don't specify the model id (huggingface id) in both places I end up with "sentence-transformers/msmarco-distilbert-base-tas-b", presumably because that's what they used in that blog post. This can be smoother.

What solution would you like?
I would like to EITHER 1/ only provide the model_id when I instantiate the SentenceTransformerModel and it gets used in all class methods where applicable, rather than randomly defaulting back to "distilbert-tas-b" OR 2/ use save_as_pt as a static method and never instantiate the class at all. Also it would be nice if I could specify the output location of make_model_config_json.

What alternatives have you considered?
A clear and concise description of any alternative solutions or features you've considered.

Do you have any additional context?
Add any other context or screenshots about the feature request here.

@HenryL27 HenryL27 added enhancement New feature or request untriaged labels Oct 20, 2023
@HenryL27 HenryL27 changed the title Only require model_id once to save a model [FEATURE] Only require model_id once to save a model Oct 20, 2023
@Vinay-Vinod
Copy link
Contributor

Can I be assigned to this issue

@dhrubo-os
Copy link
Collaborator

sure assigned it to you @Vinay-Vinod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants