Files
English_To_Bengali_Translation/README.md
ModelHub XC 8d45b2f0af 初始化项目,由ModelHub XC社区提供模型
Model: mnsm92/English_To_Bengali_Translation
Source: Original Platform
2026-08-24 09:49:18 +08:00

2.0 KiB
Raw Blame History

tags, library_name, base_model, widget, license, pipeline_tag
tags library_name base_model widget license pipeline_tag
text-generation-inference
text-generation
peft
transformers
meta-llama/Llama-3.2-1B-Instruct
messages
role content
user What is your favorite condiment?
cc-by-2.0 text-generation

Model Trained Using AutoTrain

This model is created from llama3.2 1B Instruct. email me at: nazmus.sakib.muzahid@gmail.com

Usage


from transformers import pipeline
import nltk
from nltk.tokenize import sent_tokenize

nltk.download("punkt_tab")

pipe = pipeline("text-generation", max_new_tokens=512, do_sample=False, model="mnsm92/English_To_Bengali_Translation")

def create_messages(ot: str):
    messages = [

        {
            "role": "system",
            "content": "Translate English to Bengali. Keep the meaning same"
        },
        {"role": "user", "content": ot}
    ]

    return messages

text = """
National Citizen Party (NCP) convenor Nahid Islam has said that his party will contest the upcoming 13th Jatiya Sangsad (national parliament) election in alliance with Jamaat-e-Islami and like-minded parties.

However, he emphasised that there is no ideological unity between the NCP and Jamaat or its allies, describing the arrangement instead as an electoral understanding.

Nahid Islam made the remarks at a press conference held at the NCPs temporary central office in the capitals Banglamotor area on Sunday night.

Earlier in the afternoon, Jamaat-e-Islami and its like-minded parties had announced at their own press conference that the NCP would be part of their 10-party electoral understanding.

Speaking at the NCP press conference, Nahid Islam outlined the background to the understanding with Jamaat and eight other parties.
"""


sentences = sent_tokenize(text)
sentences = [ create_messages(sent) for sent in sentences]
outputs = pipe(sentences, batch_size=32, truncation=True)
output_texts = ""
for i in outputs:
    output_texts += i[0]['generated_text'][-1]['content']
output_texts.replace("assistant\n\n", " ")

Drop a feedback.