Spaces:
Runtime error
Runtime error
File size: 500 Bytes
43fda7e 7052a46 6041521 43fda7e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
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) |