ppbrown commited on
Commit
d1aa991
1 Parent(s): ad82cdf

update comments

Browse files
Files changed (1) hide show
  1. generate-distances.py +6 -7
generate-distances.py CHANGED
@@ -1,11 +1,12 @@
1
  #!/usr/bin/python3
2
 
3
- """ Work in progress
4
  Plan:
5
  Read in fullword.json for list of words and token
6
  Read in pre-calculated "proper" embedding for each token from safetensor file
7
- Generate a tensor array of distance for each token, to every other token/embedding
8
- Save it out
 
9
  """
10
 
11
 
@@ -97,8 +98,6 @@ def find_closest(targetword):
97
  print_distances(targetemb)
98
 
99
 
100
-
101
- print("Input a word now:")
102
- for line in sys.stdin:
103
- input_text = line.rstrip()
104
  find_closest(input_text)
 
1
  #!/usr/bin/python3
2
 
3
+ """
4
  Plan:
5
  Read in fullword.json for list of words and token
6
  Read in pre-calculated "proper" embedding for each token from safetensor file
7
+ Prompt user for a word from the list
8
+ Generate a tensor array of distance to all the other known words
9
+ Print out the 20 closest ones
10
  """
11
 
12
 
 
98
  print_distances(targetemb)
99
 
100
 
101
+ while True:
102
+ input_text=input("Input a word now:")
 
 
103
  find_closest(input_text)