patpizio commited on
Commit
be3d74a
1 Parent(s): ee17a02

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -6
app.py CHANGED
@@ -4,11 +4,16 @@ from transformers import AutoTokenizer, T5Tokenizer, T5ForConditionalGeneration,
4
 
5
  st.title('How do LLM choose their words?')
6
 
7
- model_checkpoint = st.selectbox(
8
- "Model:",
9
- ("google/flan-t5-base", "google/flan-t5-xl")
10
- )
11
- temperature = st.number_input('Temperature: ', min_value=0.0, max_value=1.0, value=0.5, format='%f')
 
 
 
 
 
12
 
13
  tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
14
 
@@ -57,4 +62,6 @@ if instruction:
57
  skip_special_tokens=False
58
  ).strip()
59
 
60
- st.write(output_text)
 
 
 
4
 
5
  st.title('How do LLM choose their words?')
6
 
7
+ col1, col2 = st.columns(2)
8
+
9
+ with col1:
10
+ model_checkpoint = st.selectbox(
11
+ "Model:",
12
+ ("google/flan-t5-base", "google/flan-t5-xl")
13
+ )
14
+
15
+ with col2:
16
+ temperature = st.number_input('Temperature: ', min_value=0.0, max_value=1.0, value=0.5, format='%f')
17
 
18
  tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
19
 
 
62
  skip_special_tokens=False
63
  ).strip()
64
 
65
+ st.write(output_text)
66
+
67
+ st.write(model.compute_transition_scores(outputs.sequences, outputs.scores, normalize_logits=False))