Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,11 @@
|
|
|
|
1 |
import fasttext
|
2 |
-
import os
|
3 |
import gradio as gr
|
4 |
-
from huggingface_hub import hf_hub_download
|
5 |
-
|
6 |
-
# Téléchargement du modèle depuis Hugging Face
|
7 |
-
model_path = hf_hub_download(repo_id="facebook/nllb-200-distilled-1.3B", filename="lid218e.bin")
|
8 |
|
9 |
-
#
|
10 |
-
|
11 |
-
raise ValueError(f"Le modèle {model_path} n'a pas pu être téléchargé!")
|
12 |
|
13 |
-
# Charger le modèle avec
|
14 |
model = fasttext.load_model(model_path)
|
15 |
|
16 |
# Fonction de prédiction de la langue
|
|
|
1 |
+
from huggingface_hub import hf_hub_download
|
2 |
import fasttext
|
|
|
3 |
import gradio as gr
|
|
|
|
|
|
|
|
|
4 |
|
5 |
+
# Télécharger le modèle depuis Hugging Face
|
6 |
+
model_path = hf_hub_download(repo_id="facebook/fasttext-language-identification", filename="model.bin")
|
|
|
7 |
|
8 |
+
# Charger le modèle avec fastText
|
9 |
model = fasttext.load_model(model_path)
|
10 |
|
11 |
# Fonction de prédiction de la langue
|