File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,47 @@ finalfrontier-python is a Python module for
77finalfrontier-python is still under development, precompiled modules will be
88made available in the future.
99
10+ ## Building the module
11+
12+ First, you need ` pyo3-pack ` :
13+
14+ ~~~ shell
15+ $ cargo install pyo3-pack
16+ ~~~
17+
18+ Now you can build finalfrontier-python in a virtual environment:
19+
20+ ~~~ shell
21+ $ python3 -m venv ff-env
22+ $ source ff-env/bin/activate
23+ $ pyo3-pack develop --release
24+ ~~~
25+
26+ To build a wheel:
27+
28+ ~~~ shell
29+ $ pyo3-pack build --release
30+ ~~~
31+
32+ ## Usage
33+
34+ A finalfrontier model can be loaded as follows:
35+
36+ ~~~ python
37+ import finalfrontier
38+ model = finalfrontier.Model(" /Users/daniel/git/finalfrontier/throwaway.bin" )
39+ ~~~
40+
41+ You can then compute an embedding, perform similarity queries, or analogy
42+ queries:
43+
44+ ~~~ python
45+ e = model.embedding(" Tübingen" )
46+ model.similarity(" Tübingen" )
47+ model.analogy(" Berlin" , " Deutschland" , " Amsterdam" )
48+ ~~~
49+
50+
1051## Where to go from here
1152
1253 * [ finalfrontier] ( https://git.danieldk.eu/finalfrontier/about )
You can’t perform that action at this time.
0 commit comments