Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from huggingface_hub import hf_hub_download
|
3 |
+
import fasttext
|
4 |
+
|
5 |
+
model = fasttext.load_model(hf_hub_download("NbAiLab/nb-nordic-lid", "model.bin"))
|
6 |
+
|
7 |
+
|
8 |
+
def identify(text):
|
9 |
+
return model.predict(text)
|
10 |
+
|
11 |
+
iface = gr.Interface(fn=identify, inputs="text", outputs="text")
|
12 |
+
iface.launch()
|