Spaces:
Sleeping
Sleeping
File size: 385 Bytes
909b12c 01a4186 909b12c |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import gradio as gr
import fasttext
from huggingface_hub import hf_hub_download
model_path = hf_hub_download(repo_id="facebook/fasttext-language-identification", filename="model.bin")
model = fasttext.load_model(model_path)
def classify(input):
result = model.predict(input, k=5)
return result
iface = gr.Interface(fn=classify, inputs="text", outputs="Label")
iface.launch() |