We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 01acdcd commit 18d70dfCopy full SHA for 18d70df
examples/embedding/huggingface_tei_example.py
@@ -0,0 +1,17 @@
1
+# -*- coding: utf-8 -*-
2
+import sys
3
+sys.path.append(".")
4
+from modelcache.embedding.huggingface_tei import HuggingfaceTEI
5
+
6
+'''
7
+run tei server:
8
+text-embeddings-router --model-id BAAI/bge-large-zh-v1.5 --port 8080
9
10
11
+def run():
12
+ tei_instance = HuggingfaceTEI('http://127.0.0.1:8080/v1/embeddings', 'BAAI/bge-large-zh-v1.5')
13
+ print('dimenson', tei_instance.dimension)
14
+ print('embedding', tei_instance.to_embeddings('hello'))
15
16
+if __name__ == '__main__':
17
+ run()
0 commit comments