Text Generation
Transformers
Safetensors
Telugu
English
Inference Endpoints
Telugu-LLM-Labs commited on
Commit
bdf7ec3
1 Parent(s): 56ef217

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +36 -1
README.md CHANGED
@@ -28,7 +28,7 @@ The model is finetuned only on native telugu SFT data from above datasets and we
28
  ## Response: {response}
29
  ```
30
 
31
- # Usage
32
 
33
  ```python3
34
  from unsloth import FastLanguageModel
@@ -67,6 +67,41 @@ outputs = model.generate(**inputs, max_new_tokens = 300, use_cache = True)
67
  response = tokenizer.batch_decode(outputs)
68
  ```
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  # Sample Questions and Responses
71
 
72
  ## Reasoning
 
28
  ## Response: {response}
29
  ```
30
 
31
+ # Usage with Unsloth
32
 
33
  ```python3
34
  from unsloth import FastLanguageModel
 
67
  response = tokenizer.batch_decode(outputs)
68
  ```
69
 
70
+ # Usage with HuggingFace
71
+
72
+ ```python3
73
+ from peft import AutoPeftModelForCausalLM
74
+ from transformers import AutoTokenizer
75
+
76
+ model = AutoPeftModelForCausalLM.from_pretrained(
77
+ "Telugu-LLM-Labs/Telugu-gemma-2b-finetuned-sft",
78
+ load_in_4bit = False,
79
+ token = hf_token
80
+ )
81
+ tokenizer = AutoTokenizer.from_pretrained("Telugu-LLM-Labs/Telugu-gemma-2b-finetuned-sft")
82
+
83
+ input_prompt = """
84
+ ### Instruction:
85
+ {}
86
+
87
+ ### Input:
88
+ {}
89
+
90
+ ### Response:
91
+ {}"""
92
+
93
+ input_text = input_prompt.format(
94
+ "కింది వచనాన్ని రెండు పాయింట్లలో సంగ్రహించండి.", # instruction
95
+ "Google వార్తలు అనేది Google ద్వారా అభివృద్ధి చేయబడిన వార్తా అగ్రిగేటర్ సేవ. ఇది వేలకొద్దీ ప్రచురణకర్తలు మరియు మ్యాగజైన్‌ల నుండి నిర్వహించబడిన కథనాలకు నిరంతర లింక్‌లను అందిస్తుంది. Google వార్తలు Android, iOS మరియు వెబ్‌లో యాప్‌గా అందుబాటులో ఉన్నాయి. గూగుల్ సెప్టెంబరు 2002లో బీటా వెర్షన్‌ను మరియు జనవరి 2006లో అధికారిక యాప్‌ను విడుదల చేసింది.", # input
96
+ "", # output - leave this blank for generation!
97
+ )
98
+
99
+ inputs = tokenizer([input_text], return_tensors = "pt").to("cuda")
100
+
101
+ outputs = model.generate(**inputs, max_new_tokens = 300, use_cache = True)
102
+ response = tokenizer.batch_decode(outputs)[0]
103
+ ```
104
+
105
  # Sample Questions and Responses
106
 
107
  ## Reasoning