Instructions to use panigrah/wineberto-t5-s2s with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use panigrah/wineberto-t5-s2s with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="panigrah/wineberto-t5-s2s")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("panigrah/wineberto-t5-s2s") model = AutoModelForSeq2SeqLM.from_pretrained("panigrah/wineberto-t5-s2s") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use panigrah/wineberto-t5-s2s with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "panigrah/wineberto-t5-s2s" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "panigrah/wineberto-t5-s2s", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/panigrah/wineberto-t5-s2s
- SGLang
How to use panigrah/wineberto-t5-s2s with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "panigrah/wineberto-t5-s2s" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "panigrah/wineberto-t5-s2s", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "panigrah/wineberto-t5-s2s" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "panigrah/wineberto-t5-s2s", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use panigrah/wineberto-t5-s2s with Docker Model Runner:
docker model run hf.co/panigrah/wineberto-t5-s2s
YAML Metadata Warning:The pipeline tag "text2text-generation" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other
Wineberto T5
T5 model fine tuned on the winemag reviews dataset to generate wine descriptions using text to text generation. There is some correlation between the wine label and the description based on whats provided in the inputs such as wine variety, country and region.
Model description
How to use
You can use this model directly like so. Prefix the wine label with the string describe:
>>> from transformers import pipeline
>>> seq = pipeline('text2text-generation', model='panigrah/winberto-t5-s2s')
>>> seq(["describe: Pinot Noir Russian River Valley US", "describe: Pinot Noir Willamette Valley Oregon"], max_new_tokens=128, num_beams=5, no_repeat_ngram_size=2, early_stopping=True)
[{'generated_text': "This is a light, fruity Pinot Noir, with aromas of red cherry, cranberry and pomegranate. It's light in body and light on the palate, offering flavors of cherry and raspberry. The finish is clean and clean."},
{'generated_text': "This is a ripe, full-bodied Pinot Noir. It's full bodied and supple in feel, with flavors of cherry, raspberry, cola and spice. The tannins are firm and firm, and the wine is ready to drink."}]
Training data
The T5-small model was fine tuned with 150K wine review descriptions and with a ROUGE metric. Learning rate was kept high to make the model converge faster - higher LRs work better for T5 based on this discussion Used a ROUGE metric to measure performance - highest ROUGE on stopping training had ROUGE1 of around 25 and ROUGE2 of about 15. Will continue trying to tune training parameters to see if we can get better results.
- Downloads last month
- 11