versae commited on
Commit
cbd7b15
1 Parent(s): a9d1f48

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
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()