Views
No views yet
unsloth/llama-3-8b-Instruct-bnb-4bit1pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
2pip install --no-deps xformers trl peft accelerate bitsandbytes1from unsloth import FastLanguageModel
2import torch
3
4model, tokenizer = FastLanguageModel.from_pretrained(
5 model_name="suyash2739/English_to_Hinglish_fintuned_lamma_3_8b_instruct",
6 max_seq_length=2048,
7 dtype=None, # auto-detect; float16 for T4/V100, bfloat16 for Ampere+
8 load_in_4bit=True,
9)
10
11def translate(text):
12 prompt = """Translate the input from English to Hinglish to give the response.
13
14### Input:
15{}
16
17### Response:
18"""
19 inputs = tokenizer([prompt.format(text)], return_tensors="pt").to("cuda")
20 outputs = model.generate(**inputs, max_new_tokens=2048, use_cache=True)
21 raw = tokenizer.batch_decode(outputs)[0]
22 return raw.split("### Response:\n")[1].split("<|eot_id|>")[0]
23
24print(translate("This is a fine-tuned Hinglish translation model using Llama 3."))
25# Yeh ek fine-tuned Hinglish translation model hai jo Llama 3 ka istemal karta hai.
Finance Minister Nirmala Sitharaman said, "There used to be a poverty index...a human development index and all of them continue, but today what is keenly watched is VIX, the volatility index of the markets." Stability of the government is important for markets to be efficient, she stated. PM Narendra Modi's third term will make markets function with stability, she added.
Finance Minister Nirmala Sitharaman ne kaha, "Pehle ek poverty index hota tha...ek human development index hota tha aur yeh sab ab bhi hain, lekin aaj jo sabse zyada dekha ja raha hai, woh hai VIX, jo markets ka volatility index hai." Unhone kaha ki sarkar ki stability markets ke efficient hone ke liye zaroori hai. PM Narendra Modi ka teesra term markets ko stability ke saath function karne mein madad karega, unhone joda.
Finance Minister Nirmala Sitharaman ne kaha, "Pehle ek poverty index hota tha... ek human development index hota tha aur sab kuch ab bhi chal raha hai, lekin aaj jo kaafi zyada dekha ja raha hai, woh VIX hai, jo markets ki volatility ka index hai." Unhone kaha ki markets ke liye sarkar ki stability zaroori hai. PM Narendra Modi ke teesre term se markets stability ke saath function karenge, unhone joda.
1@misc{agarwal2024newshinglish,
2 author = {Agarwal, Suyash},
3 title = {News\_Hinglish\_English: An English--Hinglish Parallel Corpus},
4 year = {2024},
5 publisher = {Hugging Face},
6 doi = {10.57967/hf/5120},
7 url = {https://huggingface.co/datasets/suyash2739/News_Hinglish_English}
8}