yash161101 commited on
Commit
9ab5a1a
1 Parent(s): cab23ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -21,8 +21,8 @@ model, tokenizer = get_model()
21
  #g =
22
  c = 5
23
  with st.form(key='my_form'):
24
- prompt = st.text_input('Enter sentence', '')
25
- #prompt = st.text_area(label='Enter Number of words', value=c)
26
  submit_button = st.form_submit_button(label='Submit')
27
  if submit_button:
28
  with torch.no_grad():
@@ -39,6 +39,6 @@ with st.form(key='my_form'):
39
  best_probabilities = probabilities[best_indices].tolist()
40
  words = []
41
 
42
- best_words = ' '.join(best_words[0:5])
43
  final_string = prompt + best_words
44
  st.write(final_string)
 
21
  #g =
22
  c = 5
23
  with st.form(key='my_form'):
24
+ prompt = st.text_input('Enter sentence:', '')
25
+ c = st.number_input(label='Enter Number of words: ', 1)
26
  submit_button = st.form_submit_button(label='Submit')
27
  if submit_button:
28
  with torch.no_grad():
 
39
  best_probabilities = probabilities[best_indices].tolist()
40
  words = []
41
 
42
+ best_words = ' '.join(best_words[0:c])
43
  final_string = prompt + best_words
44
  st.write(final_string)