|
--- |
|
license: mit |
|
tags: |
|
- llama-2 |
|
- mlx |
|
language: |
|
- fr |
|
- el |
|
library_name: mlx |
|
pipeline_tag: text-generation |
|
--- |
|
|
|
<img src="https://l0d0v1c.github.io/notes/medias/greeks.jpg"/> |
|
|
|
# An Ancient Greek/French Model for RAG |
|
|
|
* based on mistralai/Mistral-7B-v0.1 |
|
* Trained on [1] (and automated translation by GTP4) and [2] |
|
* For RAG [3] |
|
* may produce unaccurate results in translation |
|
* https://www.diogenial.com https://rd-mediation.com |
|
* Framework MLX Apple Silicon [4] |
|
|
|
## Example |
|
<code>La traduction de Φασὶ δὲ καὶ Ἀλέξανδρον εἰπεῖν ὡς εἴπερ Ἀλέξανδρος μὴ ἐγεγόνει, ἐθελῆσαι ἂν Διογένης γενέσθαι est: |
|
Diogène dit que si Alexandre avait été moins ambitieux, il aurait bien voulu être Diogène.</code> |
|
(imprécise: On assure qu’Alexandre disait que s’il n’était pas Alexandre il voudrait être Diogène. selon [5]) |
|
|
|
## Use |
|
<code>from mlx_lm import load, generate |
|
|
|
model, tokenizer = load("RANDMEDIATION/DiogenialRAG") |
|
|
|
response = generate(model, tokenizer, prompt=input("prompt:"), verbose=True,max_tokens=256,temp=0.8)</code> |
|
|
|
|
|
## References |
|
[1] Giannantoni, Gabriele, éd. Socratis et Socraticorum reliquiae. Elenchos 18. Book V. Naples, Italy: Bibliopolis, 1990. |
|
|
|
[2] https://tatoeba.org/fr/sentences/show_all_in/grc/none |
|
|
|
[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. |
|
|
|
[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. |
|
|
|
[5] https://remacle.org/bloodwolf/philosophes/laerce/6diogene1.htm |