AlekseyV commited on
Commit
7dacf2f
·
verified ·
1 Parent(s): 05faee0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -4,7 +4,8 @@ from fastembed import SparseTextEmbedding
4
  def sparseembed(docs):
5
  model = SparseTextEmbedding(model_name="Qdrant/bm25")
6
  embeddings = list(model.embed(docs))
7
- return [(x.values, x.indices) for x in embeddings]
 
8
 
9
  iface = gr.Interface(
10
  fn=sparseembed,
@@ -16,4 +17,4 @@ iface = gr.Interface(
16
  )
17
 
18
  if __name__ == "__main__":
19
- iface.launch()
 
4
  def sparseembed(docs):
5
  model = SparseTextEmbedding(model_name="Qdrant/bm25")
6
  embeddings = list(model.embed(docs))
7
+ # преобразуем x.values и x.indices в list
8
+ return [ (x.values.tolist(), x.indices.tolist()) for x in embeddings ]
9
 
10
  iface = gr.Interface(
11
  fn=sparseembed,
 
17
  )
18
 
19
  if __name__ == "__main__":
20
+ iface.launch()