futranbg commited on
Commit
909b12c
Β·
1 Parent(s): 44ed60b

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import fasttext
3
+ from huggingface_hub import hf_hub_download
4
+
5
+ model_path = hf_hub_download(repo_id="facebook/fasttext-language-identification", filename="model.bin")
6
+ model = fasttext.load_model(model_path)
7
+
8
+ def classify(input):
9
+ result = model.predict(input, k=5)
10
+ return result
11
+
12
+ iface = gr.Interface(fn=greet, inputs="text", outputs="text")
13
+ iface.launch()