Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ st.write('Try to guess a secret word by semantic similarity')
|
|
18 |
|
19 |
word = st.text_input("Input a word")
|
20 |
|
21 |
-
if st.button("Guess"):
|
22 |
word_embedding = model.encode(word)
|
23 |
similarity = util.pytorch_cos_sim(secred_embedding, word_embedding).cpu().numpy()[0][0]
|
24 |
st.session_state['words'].append((word, similarity))
|
|
|
18 |
|
19 |
word = st.text_input("Input a word")
|
20 |
|
21 |
+
if st.button("Guess") or word:
|
22 |
word_embedding = model.encode(word)
|
23 |
similarity = util.pytorch_cos_sim(secred_embedding, word_embedding).cpu().numpy()[0][0]
|
24 |
st.session_state['words'].append((word, similarity))
|