Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,147 @@
|
|
1 |
-
---
|
2 |
-
license: gemma
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: gemma
|
3 |
+
library_name: transformers
|
4 |
+
pipeline_tag: text-generation
|
5 |
+
extra_gated_button_content: Acknowledge license
|
6 |
+
tags:
|
7 |
+
- rag
|
8 |
+
language:
|
9 |
+
- ar
|
10 |
+
- en
|
11 |
+
model-index:
|
12 |
+
- name: SILMA-Kashif-2B-Instruct-v1.0
|
13 |
+
results:
|
14 |
+
- task:
|
15 |
+
type: text-generation
|
16 |
+
dataset:
|
17 |
+
name: SILMA RAGQA Benchmark Dataset V1.0
|
18 |
+
type: silma-ai/silma-rag-qa-benchmark-v1.0
|
19 |
+
metrics:
|
20 |
+
- name: SILMA RAGQA Benchmark Score
|
21 |
+
type: Average of Exact Match, BLEU, ROUGE, and BERTScore.
|
22 |
+
value: 0.347
|
23 |
+
source:
|
24 |
+
name: SILMA RAGQA Benchmark
|
25 |
+
url: https://huggingface.co/datasets/silma-ai/silma-rag-qa-benchmark-v1.0
|
26 |
+
---
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
+
|
31 |
+
## SILMA Kashif Model
|
32 |
+
|
33 |
+
* **SILMA Kashif 2B Instruct v1.0** is the initial release within the SILMA Kashif Family of models, specifically designed for **RAG** (Retrieval-Augmented Generation) tasks
|
34 |
+
* Kashif excels in a specific task, answering questions based on contextual pieces in both Arabic and English. In addition, the model is also capable of performing Entity Extraction tasks as a minor skill
|
35 |
+
* SILMA Kashif 2B v1.0 stands out as the top-performing open model within the 3-9 billion parameter range based on our evaluations using [SILMA RAGQA Benchmark](https://huggingface.co/datasets/silma-ai/silma-rag-qa-benchmark-v1.0)
|
36 |
+
* SILMA is built over the robust foundational models of Google Gemma, combining the strengths of both to provide you with unparalleled performance
|
37 |
+
* SILMA is an open-weight model, free to use in accordance with our open license
|
38 |
+
* Finally, the model comes with a context length of 12k
|
39 |
+
|
40 |
+
|
41 |
+
## Model Skill and Capabilities
|
42 |
+
|
43 |
+
The large language model underwent rigorous training to excel in performing a variety of skills:
|
44 |
+
|
45 |
+
- The ability to answer general questions in Arabic and English
|
46 |
+
- The ability to deal with short and long contexts
|
47 |
+
- The ability to provide short and long answers effectively
|
48 |
+
- The ability to answer complex numerical questions
|
49 |
+
- The ability to answer questions based on tabular data
|
50 |
+
- Answering multi-hop questions: The ability to answer a single question using pieces of data from multiple paragraphs
|
51 |
+
- Negative rejection: The ability to identify and exclude inaccurate answers, and provide a more accurate statement such as "The answer cannot be found in the given context"
|
52 |
+
- Multi-domains: The ability to answer questions based on texts from different fields such as finance, medical, legal, etc.
|
53 |
+
- The ability to deal with ambiguous contexts
|
54 |
+
- The ability to extract entities from text
|
55 |
+
- Ability to deal with diverse and complex prompts
|
56 |
+
|
57 |
+
|
58 |
+
## SILMA AI
|
59 |
+
|
60 |
+
[silma.ai](https://silma.ai) is a leading Generative AI startup dedicated to empowering Arabic speakers with state-of-the-art AI solutions.
|
61 |
+
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
+
### Usage
|
66 |
+
|
67 |
+
Below we share some code snippets on how to get quickly started with running the model. First, install the Transformers library with:
|
68 |
+
|
69 |
+
```sh
|
70 |
+
pip install -U transformers
|
71 |
+
```
|
72 |
+
|
73 |
+
Then, copy the snippet from the section that is relevant for your usecase.
|
74 |
+
|
75 |
+
#### Running with the `pipeline` API
|
76 |
+
|
77 |
+
```python
|
78 |
+
import torch
|
79 |
+
from transformers import pipeline
|
80 |
+
|
81 |
+
pipe = pipeline(
|
82 |
+
"text-generation",
|
83 |
+
model="silma-ai/SILMA-Kashif-2B-Instruct-v1.0",
|
84 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
85 |
+
device="cuda", # replace with "mps" to run on a Mac device
|
86 |
+
)
|
87 |
+
|
88 |
+
messages = [
|
89 |
+
{"role": "user", "content": "اكتب رسالة تعتذر فيها لمديري في العمل عن الحضور اليوم لأسباب مرضية."},
|
90 |
+
]
|
91 |
+
|
92 |
+
outputs = pipe(messages, max_new_tokens=256)
|
93 |
+
assistant_response = outputs[0]["generated_text"][-1]["content"].strip()
|
94 |
+
print(assistant_response)
|
95 |
+
```
|
96 |
+
|
97 |
+
- Response:
|
98 |
+
|
99 |
+
```text
|
100 |
+
السلام عليكم ورحمة الله وبركاته
|
101 |
+
|
102 |
+
أودّ أن أعتذر عن عدم الحضور إلى العمل اليوم بسبب مرضي. أشعر بالسوء الشديد وأحتاج إلى الراحة. سأعود إلى العمل فور تعافيي.
|
103 |
+
شكراً لتفهمكم.
|
104 |
+
|
105 |
+
مع تحياتي،
|
106 |
+
[اسمك]
|
107 |
+
```
|
108 |
+
|
109 |
+
|
110 |
+
### GPU Requirements
|
111 |
+
|
112 |
+
The following are the minimum/recommended GPU requirements for running inference:
|
113 |
+
|
114 |
+
* Recommended
|
115 |
+
* At least one GPU with a minimum of 24 GB of GPU memory
|
116 |
+
* Examples: Nvidia RTX 4090
|
117 |
+
|
118 |
+
* Minimum
|
119 |
+
|
120 |
+
* At least one GPU with 8-12 GB of GPU memory
|
121 |
+
* Examples: Nvidia RTX 3070 or RTX 4070
|
122 |
+
|
123 |
+
|
124 |
+
### Citation
|
125 |
+
|
126 |
+
```none
|
127 |
+
@article{silma_01_2025,
|
128 |
+
title={Silma},
|
129 |
+
url={https://www.silma.ai},
|
130 |
+
publisher={Silma},
|
131 |
+
author={Silma Team},
|
132 |
+
year={2025}
|
133 |
+
}
|
134 |
+
```
|
135 |
+
|
136 |
+
## Usage and Limitations
|
137 |
+
|
138 |
+
These models have certain limitations that users should be aware of.
|
139 |
+
|
140 |
+
### Intended Usage
|
141 |
+
|
142 |
+
* The model should only be used in question answering use-cases such as RAG
|
143 |
+
* The model can also be used to extract entities from text
|
144 |
+
|
145 |
+
### Limitations
|
146 |
+
|
147 |
+
* Due to its small number of parameters, we have found the model not to be very strong in numercial and financial reasoning (Answeeing questions which requires calculation)
|