YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

Text classification demo (Hugging Face)

This repo contains a minimal example to fine-tune a Hugging Face model for text classification.

Quick start (PowerShell):

  1. Activate your venv:
& "C:\Users\Humberto Arias\recipe_bot\venv\Scripts\Activate.ps1"
  1. Install dependencies:
pip install --upgrade pip
pip install transformers datasets accelerate evaluate huggingface-hub
  1. Smoke test:
python text_classification_demo.py --smoke-test
  1. Prepare data/train.csv with text,label columns and run training:
python text_classification_demo.py --train_file data/train.csv --model_name_or_path bert-base-uncased --output_dir ./outputs

Notes:

  • This example is intentionally minimal for learning. For larger runs, use accelerate and GPU instances.
  • To push to the Hub, huggingface-cli login then trainer.push_to_hub() can be added.

Model on the Hub

The demo model was pushed to: https://huggingface.co/x2-world/recipe-bert

Example inference (after pushing to Hub):

from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline

model_id = "x2-world/recipe-bert"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
clf = pipeline('text-classification', model=model, tokenizer=tokenizer)
print(clf('The pizza was great'))
Downloads last month
3
Safetensors
Model size
0.1B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support