Update README.md
Browse files
README.md
CHANGED
@@ -23,6 +23,24 @@ datasets:
|
|
23 |
- **License:** apache-2.0
|
24 |
- **Finetuned from model :** unsloth/Phi-3-mini-4k-instruct-bnb-4bit
|
25 |
|
26 |
-
|
27 |
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
- **License:** apache-2.0
|
24 |
- **Finetuned from model :** unsloth/Phi-3-mini-4k-instruct-bnb-4bit
|
25 |
|
26 |
+
# Use The Model
|
27 |
|
28 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
29 |
+
|
30 |
+
## Load the tokenizer and model
|
31 |
+
tokenizer = AutoTokenizer.from_pretrained("Dragneel/Phi-3-mini-Nepali-Text-Summarization-f16")
|
32 |
+
model = AutoModelForCausalLM.from_pretrained("Dragneel/Phi-3-mini-Nepali-Text-Summarization-f16")
|
33 |
+
|
34 |
+
## Example input text
|
35 |
+
input_text = "Your input text here."
|
36 |
+
|
37 |
+
## Tokenize the input text
|
38 |
+
input_ids = tokenizer.encode(input_text, return_tensors='pt')
|
39 |
+
|
40 |
+
## Generate text with adjusted parameters
|
41 |
+
outputs = model.generate(input_ids, max_new_tokens=50)
|
42 |
+
|
43 |
+
## Decode the generated tokens
|
44 |
+
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
45 |
+
|
46 |
+
print(generated_text)
|