Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -577,12 +577,23 @@ st.set_page_config(
|
|
| 577 |
)
|
| 578 |
# Path: Main.py
|
| 579 |
#Author: Sergio Demis Lopez Martinez
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 580 |
generation_config = {
|
| 581 |
-
"temperature":
|
| 582 |
-
"top_p":
|
| 583 |
-
"top_k":
|
| 584 |
-
"max_output_tokens":
|
| 585 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 586 |
#------------------------------------------------------------
|
| 587 |
SAFETY_SETTINGS = [
|
| 588 |
{"category": "HARM_CATEGORY_HARASSMENT", "threshold": "BLOCK_NONE"},
|
|
@@ -779,19 +790,19 @@ if pdf_mode:
|
|
| 779 |
else:
|
| 780 |
with st.sidebar:
|
| 781 |
st.subheader("Settings")
|
| 782 |
-
|
| 783 |
-
|
| 784 |
-
|
| 785 |
-
|
| 786 |
apply_button = st.button("Apply")
|
| 787 |
|
| 788 |
# Check if the "Apply" button is clicked
|
| 789 |
if apply_button:
|
| 790 |
# Update generation_config based on user input
|
| 791 |
-
|
| 792 |
-
|
| 793 |
-
|
| 794 |
-
|
| 795 |
|
| 796 |
with st.sidebar:
|
| 797 |
st.subheader("Safety Settings")
|
|
|
|
| 577 |
)
|
| 578 |
# Path: Main.py
|
| 579 |
#Author: Sergio Demis Lopez Martinez
|
| 580 |
+
|
| 581 |
+
temperature = 0.9
|
| 582 |
+
top_p = 1.0
|
| 583 |
+
top_k = 1
|
| 584 |
+
max_output_tokens = 1024
|
| 585 |
generation_config = {
|
| 586 |
+
"temperature": temperature,
|
| 587 |
+
"top_p": top_p,
|
| 588 |
+
"top_k": top_k,
|
| 589 |
+
"max_output_tokens": max_output_tokens,
|
| 590 |
}
|
| 591 |
+
st.sidebar.subheader("Selected Values")
|
| 592 |
+
st.sidebar.write(f"Temperature: {temperature}")
|
| 593 |
+
st.sidebar.write(f"Top P: {top_p}")
|
| 594 |
+
st.sidebar.write(f"Top K: {top_k}")
|
| 595 |
+
st.sidebar.write(f"Max Output Tokens: {max_output_tokens}")
|
| 596 |
+
|
| 597 |
#------------------------------------------------------------
|
| 598 |
SAFETY_SETTINGS = [
|
| 599 |
{"category": "HARM_CATEGORY_HARASSMENT", "threshold": "BLOCK_NONE"},
|
|
|
|
| 790 |
else:
|
| 791 |
with st.sidebar:
|
| 792 |
st.subheader("Settings")
|
| 793 |
+
temperature1 = st.slider("Temperature", 0.1, 1.0, temperature)
|
| 794 |
+
top_p1 = st.slider("Top P", 0.1, 1.0, top_p, 0.01) # Use float step
|
| 795 |
+
top_k1 = st.slider("Top K", 1, 30, top_k)
|
| 796 |
+
max_output_tokens1 = st.slider("Max Output Tokens", 100, 2048, max_output_tokens)
|
| 797 |
apply_button = st.button("Apply")
|
| 798 |
|
| 799 |
# Check if the "Apply" button is clicked
|
| 800 |
if apply_button:
|
| 801 |
# Update generation_config based on user input
|
| 802 |
+
temperature = temperature1
|
| 803 |
+
top_p = top_p1
|
| 804 |
+
top_k = top_k1
|
| 805 |
+
max_output_tokens = max_output_tokens1
|
| 806 |
|
| 807 |
with st.sidebar:
|
| 808 |
st.subheader("Safety Settings")
|