Spaces:
Sleeping
Sleeping
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="text") | |
iface.launch() |