Merge branch 'main' of https://huggingface.co/RANDMEDIATION/DiogenialRAG
Browse files
README.md
CHANGED
@@ -1,4 +1,67 @@
|
|
1 |
---
|
2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
+
tags:
|
4 |
+
- mlx
|
5 |
+
- mistral-7b
|
6 |
+
- Ancient greek
|
7 |
+
language:
|
8 |
+
- fr
|
9 |
+
- el
|
10 |
+
library_name: mlx
|
11 |
+
pipeline_tag: text-generation
|
12 |
---
|
13 |
+
|
14 |
+
<img src="https://l0d0v1c.github.io/notes/medias/greeks.jpg"/>
|
15 |
+
|
16 |
+
# An Ancient Greek/French Model for RAG
|
17 |
+
|
18 |
+
* based on mistralai/Mistral-7B-v0.1
|
19 |
+
* Trained on [1] (and automated translation by GTP4) and [2]
|
20 |
+
* For RAG [3]
|
21 |
+
* Focused on French / Ancient Greek relationship
|
22 |
+
* may produce unaccurate results in translation
|
23 |
+
* https://www.diogenial.com https://rd-mediation.com
|
24 |
+
* Framework MLX Apple Silicon [4]
|
25 |
+
|
26 |
+
## Example
|
27 |
+
### Exemple dans le corpus
|
28 |
+
```La traduction de Φασὶ δὲ καὶ Ἀλέξανδρον εἰπεῖν ὡς εἴπερ Ἀλέξανδρος μὴ ἐγεγόνει, ἐθελῆσαι ἂν Διογένης γενέσθαι est:
|
29 |
+
Diogène dit que si Alexandre avait été moins ambitieux, il aurait bien voulu être Diogène.
|
30 |
+
```
|
31 |
+
|
32 |
+
(imprécise: On assure qu’Alexandre disait que s’il n’était pas Alexandre il voudrait être Diogène. selon [5])
|
33 |
+
|
34 |
+
### Exemple hors corpus
|
35 |
+
|
36 |
+
```
|
37 |
+
La traduction de Γνῶθι σεαυτόν est Connais-toi toi-même.
|
38 |
+
```
|
39 |
+
|
40 |
+
### Exemple de thème hors corpus
|
41 |
+
|
42 |
+
```
|
43 |
+
La traduction de la phrase: J'aime les machines en grec ancien est εἰμὶ δ' ἀγαπῶ τὰ μηχανήματα.
|
44 |
+
```
|
45 |
+
Ce qui signifie plus exactement "Je suis et j'aime les machines"
|
46 |
+
|
47 |
+
## Use
|
48 |
+
|
49 |
+
```
|
50 |
+
from mlx_lm import load, generate
|
51 |
+
|
52 |
+
model, tokenizer = load("RANDMEDIATION/DiogenialRAG")
|
53 |
+
|
54 |
+
response = generate(model, tokenizer, prompt=input("prompt:"), verbose=True,max_tokens=256,temp=0.8)
|
55 |
+
```
|
56 |
+
|
57 |
+
|
58 |
+
## References
|
59 |
+
[1] Giannantoni, Gabriele, éd. Socratis et Socraticorum reliquiae. Elenchos 18. Book V. Naples, Italy: Bibliopolis, 1990.
|
60 |
+
|
61 |
+
[2] https://tatoeba.org/fr/sentences/show_all_in/grc/none
|
62 |
+
|
63 |
+
[3] Lewis, Patrick, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, et al. « Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks ». In Advances in Neural Information Processing Systems, édité par H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, et H. Lin, 33:9459‑74. Curran Associates, Inc., 2020. https://proceedings.neurips.cc/paper_files/paper/2020/file/6b493230205f780e1bc26945df7481e5-Paper.pdf.
|
64 |
+
|
65 |
+
[4] Hannun, Awni, Jagrit Digani, Angelos Katharopoulos, et Ronan Collobert. « MLX: Efficient and flexible machine learning on Apple silicon », 2023. https://github.com/ml-explore.
|
66 |
+
|
67 |
+
[5] https://remacle.org/bloodwolf/philosophes/laerce/6diogene1.htm
|