Run this model with HF Jobs
Run IslemTouati/french_model on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/IslemTouati/french_model. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/IslemTouati/french_model on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use IslemTouati/french_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use IslemTouati/french_model with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("IslemTouati/french_model") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - setfit
How to use IslemTouati/french_model with setfit:
from setfit import SetFitModel model = SetFitModel.from_pretrained("IslemTouati/french_model") preds = model.predict(["i loved the spiderman movie!", "pineapple on pizza is the worst"]) print(preds) - Notebooks
- Google Colab
- Kaggle
Commit ·
cd217ac
1
Parent(s): f7a6f2b
Add SetFit model
Browse filesFiles changed (12)
- 1_Pooling/config.jsonAdded+7
- README.mdAdded+49
- config.jsonAdded+29
- config_sentence_transformers.jsonAdded+7
- model_head.pklAdded+3
- modules.jsonAdded+14
- pytorch_model.binAdded+3
- sentence_bert_config.jsonAdded+4
- sentencepiece.bpe.modelAdded+3
- special_tokens_map.jsonAdded+19
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+24
1234567{ "word_embedding_dimension": 1024, "pooling_mode_cls_token": false, "pooling_mode_mean_tokens": true, "pooling_mode_max_tokens": false, "pooling_mode_mean_sqrt_len_tokens": false}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849---license: apache-2.0tags:- setfit- sentence-transformers- text-classificationpipeline_tag: text-classification---
# IslemTouati/french_model
This is a [SetFit model](https://github.com/huggingface/setfit) that can be used for text classification. The model has been trained using an efficient few-shot learning technique that involves:
1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.2. Training a classification head with features from the fine-tuned Sentence Transformer.
## Usage
To use this model for inference, first install the SetFit library:
```bashpython -m pip install setfit```
You can then run inference as follows:
```pythonfrom setfit import SetFitModel
# Download from Hub and run inferencemodel = SetFitModel.from_pretrained("IslemTouati/french_model")# Run inferencepreds = model(["i loved the spiderman movie!", "pineapple on pizza is the worst 🤮"])```
## BibTeX entry and citation info
```bibtex@article{https://doi.org/10.48550/arxiv.2209.11055,doi = {10.48550/ARXIV.2209.11055},url = {https://arxiv.org/abs/2209.11055},author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},title = {Efficient Few-Shot Learning Without Prompts},publisher = {arXiv},year = {2022},copyright = {Creative Commons Attribution 4.0 International}}```1234567891011121314151617181920212223242526272829{ "_name_or_path": "/root/.cache/torch/sentence_transformers/dangvantuan_sentence-camembert-large", "architectures": [ "CamembertModel" ], "attention_probs_dropout_prob": 0.1, "bos_token_id": 0, "classifier_dropout": null, "eos_token_id": 2, "gradient_checkpointing": false, "hidden_act": "gelu", "hidden_dropout_prob": 0.1, "hidden_size": 1024, "initializer_range": 0.02, "intermediate_size": 4096, "layer_norm_eps": 1e-05, "max_position_embeddings": 514, "model_type": "camembert", "num_attention_heads": 16, "num_hidden_layers": 24, "output_past": true, "pad_token_id": 1, "position_embedding_type": "absolute", "torch_dtype": "float32", "transformers_version": "4.28.1", "type_vocab_size": 1, "use_cache": true, "vocab_size": 32005}1234567{ "__version__": { "sentence_transformers": "2.2.2", "transformers": "4.28.1", "pytorch": "2.0.0+cu118" }}123version https://git-lfs.github.com/spec/v1oid sha256:fd68126c14c81d5b59ce6a8795541daeb59fccb109c988423103468b26b643d1size 336231234567891011121314[ { "idx": 0, "name": "0", "path": "", "type": "sentence_transformers.models.Transformer" }, { "idx": 1, "name": "1", "path": "1_Pooling", "type": "sentence_transformers.models.Pooling" }]123version https://git-lfs.github.com/spec/v1oid sha256:cbf0b33e810af8ce5c39e0f6e4dd124aa32384896dc2d74f98c09194bab6f2d2size 13467823171234{ "max_seq_length": 514, "do_lower_case": false}123version https://git-lfs.github.com/spec/v1oid sha256:f98f266fdc548c94216aaadc13ffaaafacf0c8793303e2195322d954549ea261size 80876712345678910111213141516171819{ "additional_special_tokens": [ "<s>NOTUSED", "</s>NOTUSED" ], "bos_token": "<s>", "cls_token": "<s>", "eos_token": "</s>", "mask_token": { "content": "<mask>", "lstrip": true, "normalized": true, "rstrip": false, "single_word": false }, "pad_token": "<pad>", "sep_token": "</s>", "unk_token": "<unk>"}123456789101112131415161718192021222324{ "additional_special_tokens": [ "<s>NOTUSED", "</s>NOTUSED" ], "bos_token": "<s>", "clean_up_tokenization_spaces": true, "cls_token": "<s>", "eos_token": "</s>", "mask_token": { "__type": "AddedToken", "content": "<mask>", "lstrip": true, "normalized": true, "rstrip": false, "single_word": false }, "model_max_length": 1000000000000000019884624838656, "pad_token": "<pad>", "sep_token": "</s>", "sp_model_kwargs": {}, "tokenizer_class": "CamembertTokenizer", "unk_token": "<unk>"}1_Pooling/config.jsonAdded+7
README.mdAdded+49
config.jsonAdded+29
config_sentence_transformers.jsonAdded+7
model_head.pklAdded+3
modules.jsonAdded+14
pytorch_model.binAdded+3
sentence_bert_config.jsonAdded+4
sentencepiece.bpe.modelAdded+3
special_tokens_map.jsonAdded+19
tokenizer.jsonAdded
tokenizer_config.jsonAdded+24