Spaces:
Runtime error
Runtime error
import gradio as gr | |
import fasttext | |
import fasttext.util | |
fasttext.util.download_model('arz', if_exists='ignore') # E Arabic | |
#ft = fasttext.load_model('cc.fa.300.bin') | |
ft = fasttext.load_model('cc.arz.300.bin') | |
def getVectors(fname): | |
data = {} | |
data[tokens[0]] = ft.get_nearest_neighbors(fname) | |
return data | |
interface = gr.Interface(fn = getVectors, | |
inputs = "text", | |
outputs = ['text'], | |
title = 'get vectors', | |
description = 'get vectors for search') | |
interface.launch(inline = False) |