Skip to content

v2 huggingface support #546

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 13 commits into from
Mar 15, 2023
Merged

v2 huggingface support #546

merged 13 commits into from
Mar 15, 2023

Conversation

montanalow
Copy link
Contributor

No description provided.

@montanalow montanalow changed the title new task types v2 huggingface support Feb 15, 2023
@montanalow montanalow force-pushed the montana/huggingface branch from 15c1b3e to 995e0b2 Compare March 1, 2023 00:31
@montanalow montanalow force-pushed the montana/huggingface branch from fe23f7d to 1574e72 Compare March 14, 2023 03:07
@montanalow montanalow marked this pull request as ready for review March 14, 2023 03:27
@montanalow montanalow requested a review from santiatpml March 14, 2023 16:39
@santiatpml
Copy link
Contributor

  • In transformers.py, model has to be resized to to length of new tokenizer model.resize_token_embeddings(len(tokenizer)) after line 298 model = AutoModelForCausalLM.from_pretrained(model_name)
  • We could reuse transform function and pipeline for different tasks instead of generate to keep the interface consistent between hugging face models and fine tuned models.

@montanalow
Copy link
Contributor Author

  • In transformers.py, model has to be resized to to length of new tokenizer model.resize_token_embeddings(len(tokenizer)) after line 298 model = AutoModelForCausalLM.from_pretrained(model_name)

👍

  • We could reuse transform function and pipeline for different tasks instead of generate to keep the interface consistent between hugging face models and fine tuned models.

I think there are a few reasons to create a new API:

  • Fine tuned models need a new name. You may fine tune gpt2 on several different tasks, so you need a way to specify which gpt2... we could upload these back to huggingface, and use your_username/gpt2-special-tuning, but it seems just as natural to use our existing project_name, since you'll also likely want to test many different base models for fine tuning in the same Project.
  • transform takes whatever arbitrary JSON (possibly omitting a model name in favor of a task, which is similar but not the same as a PostgresML deployment), and returns whatever arbitrary JSON that happens to work with the Python call. generate is a more specific API that we know should take a string input and output a string. There are further structured APIs I think we'll want for certain tasks, e.g. predict and predict_logits for text-classification, or functions to get embeddings out of models.

I wouldn't be against extending the PostgresML transform function to accept a fine tuned model name, instead of a hugging face model name, but we'd need a way to disambiguate which model store (huggingface vs fine tuned PostgresML) to reference when a model name is passed.

@montanalow montanalow merged commit c2cf3a2 into master Mar 15, 2023
@montanalow montanalow deleted the montana/huggingface branch March 15, 2023 17:05
SilasMarvin pushed a commit that referenced this pull request Oct 5, 2023
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy