Instructions to use Mr-Vicky-01/Summarization-Tamil with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Mr-Vicky-01/Summarization-Tamil with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Mr-Vicky-01/Summarization-Tamil")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("Mr-Vicky-01/Summarization-Tamil") model = AutoModelForSeq2SeqLM.from_pretrained("Mr-Vicky-01/Summarization-Tamil") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Mr-Vicky-01/Summarization-Tamil with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Mr-Vicky-01/Summarization-Tamil" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Mr-Vicky-01/Summarization-Tamil", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Mr-Vicky-01/Summarization-Tamil
- SGLang
How to use Mr-Vicky-01/Summarization-Tamil 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 "Mr-Vicky-01/Summarization-Tamil" \ --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": "Mr-Vicky-01/Summarization-Tamil", "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 "Mr-Vicky-01/Summarization-Tamil" \ --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": "Mr-Vicky-01/Summarization-Tamil", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Mr-Vicky-01/Summarization-Tamil with Docker Model Runner:
docker model run hf.co/Mr-Vicky-01/Summarization-Tamil
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
Tamil Summarization and English-to-Tamil Translation Model
Overview
This repository contains a fine-tuned model for both Tamil summarization and English-to-Tamil translation. The model was fine-tuned using the Hugging Face Transformers library. This README provides information on how to use the model and its capabilities.
Model Details
- Model Name: Mr-Vicky-01/Finetuned_tamil_summarization
- Model Type: Summarization , Translation
- Framework: Hugging Face Transformers
- Original Model: Mr-Vicky-01/Fine_tune_english_to_tamil
- Fine-tuning Dataset: HariprasathSB/tamil_summarization
- Languages Supported: English, Tamil
Usage
Installation
You can install the necessary dependencies using pip:
pip install transformers
Inference
Below is an example of how to use the model for both summarization and translation tasks:
# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("Mr-Vicky-01/Finetuned_tamil_summarization")
model = AutoModelForSeq2SeqLM.from_pretrained("Mr-Vicky-01/Finetuned_tamil_summarization")
# Example English-to-Tamil Translation:
input_text = "Be the change that you wish to see in the world."
input_ids = tokenizer.encode(input_text, return_tensors="pt").input_ids
outputs = model.generate(input_ids,max_length=128)
translated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
print("Translated Tamil Sentence:", translated_text)
# Example Tamil Summarization:
prefix = "summarize: "
tamil_article = """இது குறித்து அவர் பிபிசி தமிழிடம் கூறுகையில், "இத்தீர்ப்பை மிகச் சிறந்த முற்போக்கான தீர்ப்பாக பார்க்கிறேன்.
அடிப்படை உரிமை என்ன என்பதை மிகவும் தீவிரமாக இத்தீர்ப்பு விளக்கியுள்ளது" என்றார்.
"இந்திய அரசியலமைப்பின் 21-ஆவது விதியை மிகவும் ஆழமாக நீதிமன்றம் விளக்கியுள்ளது என்றும்,
ஏற்கனவே இரு வேறு வழக்குகளில் தனி நபர் அந்தரங்கத்தை அடிப்படை உரிமை பாதுகாக்காது எனக் குறிப்பிட்ட தீர்ப்புகளைத் திருத்தி
அந்த உரிமையை தற்போது உச்ச நீதிமன்றம் பாதுகாத்துள்ளது" என்று என்.ராம் கூறினார்.
"ஆதார் பதிவு விவகாரத்தில் இந்த தீர்ப்பு நிச்சயமாக பிரதிபலிக்கும் என்று கூறும் அவர், ஆதார் முறையைத் திணிக்க முயற்சிக்கும்
மத்திய அரசின் எண்ணம் இனி கடினமாக இருக்கும்" என்றார். "நெருக்கடி காலத்தில் நீதிபதி எச்.ஆர். கன்னா அளித்த தீர்ப்பு ஏற்படுத்திய
மாற்றத்தைப் போல இந்தத் தீர்ப்பும் சமூகத்தில் மாற்றத்தை ஏற்படுத்தலாம் என்று சிலர் கருதுவதாகவும்,மொத்தத்தில் இது ஒரு முக்கியத்துவம் நிறைந்த தீர்ப்பாகும்"
என்றும் என்.ராம் தெரிவித்தார். பிற செய்திகள் : சமூக ஊடகங்களில் பிபிசி தமிழ்"""
tamil_input_ids = tokenizer.encode(prefix + tamil_article, return_tensors="pt",truncation=True).input_ids
summary_ids = model.generate(tamil_input_ids, max_length=128)
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print("Summarized Tamil Text:", summary)
Model Output
- For translation tasks, the model outputs translated text in Tamil.
- For summarization tasks, the model outputs a summarized version of the input Tamil text.
Fine-Tuning
If you want to fine-tune the model on your own dataset, you can follow these steps:
Prepare your dataset in the appropriate format
- for summarization use prefix as "summarize: "
- for translation default no prefix, directely u can tokenize the input and tokenize the output using target_text
Model Performance
- Downloads last month
- 8
