Views
No views yet
eswardivi/llama2_telugu model page on Hugging Face. This model is a result of fine-tuning the powerful PosteriorAI/godavari-telugu-llama2-7B model on the ravithejads/telugu_alpaca_ft dataset to better serve the Telugu-speaking community.PosteriorAI/godavari-telugu-llama2-7B, a state-of-the-art Telugu language model based on the LLaMA architecture, offering advanced natural language understanding and generation capabilities.ravithejads/telugu_alpaca_ft, a curated dataset specifically designed to fine-tune language models for Telugu language tasks .1from transformers import pipeline
2
3pipe = pipeline(
4 "text-generation",
5 model="eswardivi/llama2_telugu",
6 device_map="auto",
7 model_kwargs={"load_in_8bit": True}
8)
9
10def create_prompt(instruction: str, input: str = "") -> str:
11 prompt = f"""
12 You are a helpful assistant.
13 ### Instruction:
14 {instruction}
15
16 ### Input:
17 {input}
18
19 ### Response:
20 """
21 return prompt
22
23instruction = "Krindi samaacharam prakaram google news app eppudu release ayyindi?"
24input = "Google News is a news aggregator service developed by Google. It presents a continuous flow of links to articles organized from thousands of publishers and magazines. Google News is available as an app on Android, iOS, and the Web. Google released a beta version in September 2002 and the official app in January 2006."
25
26prompt = create_prompt(instruction, input)
27print(prompt)
28out = pipe(
29 prompt,
30 num_return_sequences=1,
31 max_new_tokens=1024,
32 temperature=0.7,
33 top_p=0.9,
34 do_sample=True
35)
36
37print(out[0]['generated_text'])eswar.divi.902@gmail.com.