danrdoran commited on
Commit
61312d2
·
verified ·
1 Parent(s): 3e088ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -25,7 +25,7 @@ temperature = st.sidebar.slider("Temperature", 0.1, 1.5, 1.0, 0.1) # Default 1.
25
  top_p = st.sidebar.slider("Top-p (Nucleus Sampling)", 0.0, 1.0, 0.9, 0.05) # Default 0.9
26
  top_k = st.sidebar.slider("Top-k", 0, 100, 50, 1) # Default 50
27
  # Disable sampling when using beam search
28
- # do_sample = st.sidebar.checkbox("Enable Random Sampling", value=False)
29
 
30
  # Input field for the student
31
  student_question = st.text_input("Ask your question!")
@@ -44,11 +44,11 @@ if student_question:
44
  temperature=temperature,
45
  top_p=top_p,
46
  top_k=top_k,
47
- do_sample=False, # Disable sampling, using beam search
48
- num_beams=2, # Use beam search
49
  no_repeat_ngram_size=3, # Prevent repeating phrases of 3 words or more
50
- #length_penalty=1.0, # Discourage overly long responses
51
- early_stopping=True # Stops when it finds a sufficiently good output
52
  )
53
 
54
  # Decode the generated response
 
25
  top_p = st.sidebar.slider("Top-p (Nucleus Sampling)", 0.0, 1.0, 0.9, 0.05) # Default 0.9
26
  top_k = st.sidebar.slider("Top-k", 0, 100, 50, 1) # Default 50
27
  # Disable sampling when using beam search
28
+ do_sample = st.sidebar.checkbox("Enable Random Sampling", value=False)
29
 
30
  # Input field for the student
31
  student_question = st.text_input("Ask your question!")
 
44
  temperature=temperature,
45
  top_p=top_p,
46
  top_k=top_k,
47
+ do_sample=True, # Disable sampling, using beam search
48
+ #num_beams=2, # Use beam search
49
  no_repeat_ngram_size=3, # Prevent repeating phrases of 3 words or more
50
+ length_penalty=1.0, # Discourage overly long responses
51
+ early_stopping=False # Stops when it finds a sufficiently good output
52
  )
53
 
54
  # Decode the generated response