Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
datasets:
|
3 |
+
- erfanzar/ShareGPT4
|
4 |
+
- HuggingFaceH4/no_robots
|
5 |
+
language:
|
6 |
+
- en
|
7 |
+
- fr
|
8 |
+
- es
|
9 |
+
- zh
|
10 |
+
- ru
|
11 |
+
metrics:
|
12 |
+
- accuracy
|
13 |
+
pipeline_tag: text-generation
|
14 |
+
license: mit
|
15 |
+
---
|
16 |
+
|
17 |
+
# LinguaMatic
|
18 |
+
|
19 |
+
LinguaMatic is an advanced AI model designed to handle a wide range of Natural Language Processing (NLP) tasks. With its powerful capabilities, LinguaMatic can assist with tasks such as text classification, sentiment analysis, language translation, question answering, and much more.
|
20 |
+
|
21 |
+
## EasyDel
|
22 |
+
|
23 |
+
The model is finetuned Using a custom version of UltraChat on TPU-v4 POD using [EasyDel](https://github.com/erfanzar/EasyDeL)
|
24 |
+
|
25 |
+
## Prompting Method
|
26 |
+
|
27 |
+
LinguaMatic utilizes the llama2 prompting method to generate responses. This method, named after the friendly and intelligent llama, enhances the model's ability to engage in meaningful conversations. The `prompt_model` function provided below demonstrates how the llama2 prompting method is implemented:
|
28 |
+
|
29 |
+
```python
|
30 |
+
def prompt_model(
|
31 |
+
message: str,
|
32 |
+
chat_history: None | list[list[str]] = [],
|
33 |
+
system_prompt: str | None = None
|
34 |
+
) -> str:
|
35 |
+
do_strip = False
|
36 |
+
texts = [f"<s>[INST] <<SYS>>\n{system_prompt}\n<</SYS>>\n\n"] if system_prompt is not None else ["<s>[INST] "]
|
37 |
+
for user_input, response in chat_history:
|
38 |
+
user_input = user_input.strip() if do_strip else user_input
|
39 |
+
do_strip = True
|
40 |
+
texts.append(f'{user_input} [/INST] {response.strip()} </s><s>[INST] ')
|
41 |
+
message = message.strip() if do_strip else message
|
42 |
+
texts.append(f'{message} [/INST]')
|
43 |
+
return ''.join(texts)
|
44 |
+
```
|
45 |
+
|
46 |
+
The `prompt_model` function takes a `message` as input, along with the `chat_history` and `system_prompt`. It generates a formatted text that includes the system prompt, user inputs, and the current message. This approach allows LinguaMatic to maintain context and provide more coherent and context-aware responses.
|
47 |
+
|
48 |
+
|
49 |
+
## Contributing
|
50 |
+
|
51 |
+
We welcome contributions to enhance LinguaMatic's capabilities and improve its performance. If you encounter any issues or have suggestions for improvement, please feel free to submit a pull request or open an issue on [EasyDel](https://github.com/erfanzar/EasyDeL) GitHub repository.
|