created a model card to use the model.
Browse files
README.md
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- ne
|
4 |
+
---
|
5 |
+
### Usage
|
6 |
+
Here is an example to use the model:
|
7 |
+
|
8 |
+
```python
|
9 |
+
from transformers import StoppingCriteria, StoppingCriteriaList
|
10 |
+
from unsloth import FastLanguageModel
|
11 |
+
import torch
|
12 |
+
|
13 |
+
hf_token = "<Your-hf-token>"
|
14 |
+
max_seq_length = 2048 # Choose any! We auto support RoPE Scaling internally!
|
15 |
+
dtype = None # None for auto detection. Float16 for Tesla T4, V100, Bfloat16 for Ampere+
|
16 |
+
load_in_4bit = True # Use 4bit quantization to reduce memory usage. Can be False.
|
17 |
+
|
18 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
19 |
+
model_name = "Someman/Indic-gemma-2b-finetuned-sft-Navarasa-adapters-ne-v1.0",
|
20 |
+
max_seq_length = max_seq_length,
|
21 |
+
dtype = dtype,
|
22 |
+
load_in_4bit = load_in_4bit,
|
23 |
+
token=hf_token
|
24 |
+
)
|
25 |
+
|
26 |
+
|
27 |
+
FastLanguageModel.for_inference(model)
|
28 |
+
alpaca_prompt = """
|
29 |
+
### Instruction:
|
30 |
+
{}
|
31 |
+
|
32 |
+
### Input:
|
33 |
+
{}
|
34 |
+
|
35 |
+
### Response:
|
36 |
+
{}"""
|
37 |
+
|
38 |
+
|
39 |
+
|
40 |
+
inst = "LinkedIn मा कसरी बढ्ने? ५ अंकमा व्याख्या गर्नुहोस्"
|
41 |
+
input = ""
|
42 |
+
|
43 |
+
inputs = tokenizer(
|
44 |
+
[
|
45 |
+
alpaca_prompt.format(
|
46 |
+
inst, # instruction
|
47 |
+
input, # input
|
48 |
+
"", # output - leave this blank for generation!
|
49 |
+
)
|
50 |
+
], return_tensors = "pt").to("cuda")
|
51 |
+
|
52 |
+
# since we use packing = True it starts generating another similar sample starting with <bos>. So we are using eos_token_id = tokenizer.bos_token_id
|
53 |
+
outputs = model.generate(**inputs, max_new_tokens = 800, use_cache = True)
|
54 |
+
result = tokenizer.batch_decode(outputs)[0]
|
55 |
+
print (result)
|
56 |
+
```
|
57 |
+
|
58 |
+
<bos>
|
59 |
+
### Instruction:
|
60 |
+
LinkedIn मा कसरी बढ्ने? ५ अंकमा व्याख्या गर्नुहोस्
|
61 |
+
|
62 |
+
### Input:
|
63 |
+
|
64 |
+
|
65 |
+
### Response:
|
66 |
+
1. आफ्नो पृष्ठमा आकर्षक र आकर्षक रचनात्मक कथा सिर्जना गर्नुहोस्।
|
67 |
+
2. आफ्नो पृष्ठमा अन्य प्रयोगकर्ताहरूसँग संलग्न हुनुहोस् र आफ्नो पृष्ठमा अन्य प्रयोगकर्ताहरूसँग सम्बन्ध निर्माण गर्नुहोस्।
|
68 |
+
3. आफ्नो पृष्ठमा अन्य प्रयोगकर्ताहरूको काम र सफलताहरूको बारेमा जानकारी दिनुहोस्।
|
69 |
+
4. आफ्नो पृष्ठमा अन्य प्रयोगकर्ताहरूलाई सम्पर्क गर्न र तिनीहरूको पृष्ठहरूमा जवाफ दिन अनुमति दिनुहोस्।
|
70 |
+
5. आफ्नो पृष्ठमा अन्य प्रयोगकर्ताहरूलाई आफ्नो पृष्ठमा जडान गर्न प्रोत्साहन दिनुहोस्।<eos>
|