LAin

not-lain

AI & ML interests

custom architectures with huggingface

Articles

Organizations

not-lain's activity

posted an update 2 days ago
view post
Post
646
If you're a researcher or developing your own model πŸ‘€ you might need to take a look at huggingface's ModelHubMixin classes.
They are used to seamlessly integrate your AI model with huggingface and to save/ load your model easily πŸš€

1️⃣ make sure you're using the appropriate library version
pip install -qU "huggingface_hub>=0.22"

2️⃣ inherit from the appropriate class
from huggingface_hub import PyTorchModelHubMixin
from torch import nn

class MyModel(nn.Module,PyTorchModelHubMixin):
  def __init__(self, a, b):
    super().__init__()
    self.layer = nn.Linear(a,b)
  def forward(self,inputs):
    return self.layer(inputs)

first_model = MyModel(3,1)

4️⃣ push the model to the hub (or use save_pretrained method to save locally)
first_model.push_to_hub("not-lain/test")

5️⃣ Load and initialize the model from the hub using the original class
pretrained_model = MyModel.from_pretrained("not-lain/test")

posted an update 5 days ago
view post
Post
782
I'm looking for open-source image embedding models for RAG applications and/or multimodel embedding models if they exist in the first place.

if you have any extra resources about using, creating, or finetuning them feel free to share them below πŸ€—
replied to mwz's post 7 days ago
replied to their post 9 days ago
view reply

thank you sooooo much ❀️❀️

posted an update 9 days ago
view post
Post
1165
πŸ₯³celebrating 5K readers in one of my blog posts πŸ₯³
I came back with another one this time πŸ€“
in this blog you will learn πŸ“– :
* How to train custom AI models with the trainer API πŸš€
* integrate your AI models with HF using the mixin classes πŸ”₯

happy reading everyone πŸ€—
πŸ”—link: https://huggingface.co/blog/not-lain/trainer-api-and-mixin-classes
  • 2 replies
Β·
replied to radames's post 10 days ago
view reply

I see you're using the image slider component too, nice work ❀️❀️

replied to abhishek's post 16 days ago
posted an update 17 days ago
posted an update 19 days ago
view post
Post
1731
πŸš€ just reached 3K+ readers on this blog post about RAG using only HFπŸ€— related tools in just a little over 1 week from publishing.

πŸ“ƒthe most interesting thing about it is that you can use the FAISS index in the datasets library to retrieve your most similar documents.

πŸ”—https://huggingface.co/blog/not-lain/rag-chatbot-using-llama3

Happy reading everyone ✨
replied to VictorSanh's post 19 days ago
replied to abhishek's post 26 days ago
replied to tomaarsen's post 27 days ago
replied to HeshamHaroon's post 27 days ago
view reply

nope it's not a bug, the posts feature is now open for everyone

posted an update 28 days ago
view post
Post
2244
πŸ”₯ **transformers** 4.40.0 is out πŸ”₯

βš™οΈ you can now push your custom pipelines easily to πŸ€—, allowing people to easily use your model in a more friendly, unified way.

πŸ€“ I already updated my blog to match the new feature https://huggingface.co/blog/not-lain/custom-architectures-with-huggingface.

πŸ“ƒA list of some repos that have custom pipelines :
* briaai/RMBG-1.4
* p1atdev/siglip-tagger-test-3
* sgugger/test-dynamic-pipeline
replied to Wauplin's post about 2 months ago
view reply

x3 download speed in HfFileSystem = πŸ”₯πŸš€
I also really loved using the PyTorchModelHubMixin class πŸ€—πŸ€—

replied to Xenova's post 3 months ago
replied to Xenova's post 3 months ago
replied to victor's post 3 months ago
view reply

or like make it a badge in their profiles if they exceed 100 contributions, could be a nice motive for people to make them engage more in the hub

replied to victor's post 3 months ago
view reply

maybe πŸ§™β€β™€οΈπŸ§™β€β™‚οΈ for open sorcerers out there

replied to s3nh's post 4 months ago
replied to Tonic's post 4 months ago
view reply

we're actually an anime/meme group and i made this community for AI + anime related stuff \(οΏ£οΈΆοΏ£*\))

replied to Tonic's post 4 months ago
view reply

@Tonic we just reached 300000 members yerterday on FB πŸ₯³πŸ₯³
image.png