Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,10 +15,10 @@ DESCRIPTION = """
|
|
| 15 |
|
| 16 |
with st.sidebar:
|
| 17 |
# system_promptSide = st.text_input("Optional system prompt:")
|
| 18 |
-
temperatureSide = st.slider("情感/Temperature", min_value=0.0, max_value=1.0, value=0.
|
| 19 |
max_new_tokensSide = st.slider("最大tokens生成数", min_value=0.0, max_value=4096.0, value=4096.0, step=64.0)
|
| 20 |
-
|
| 21 |
-
|
| 22 |
|
| 23 |
model_id = 'shaowenchen/baichuan2-7b-chat-gguf'
|
| 24 |
|
|
@@ -42,7 +42,7 @@ Let's work this out in a step by step way to be sure we have the right answer.
|
|
| 42 |
conversation_history = []
|
| 43 |
|
| 44 |
# Prediction function
|
| 45 |
-
def predict(message, system_prompt='', temperature=
|
| 46 |
global conversation_history
|
| 47 |
question=message
|
| 48 |
input_text=ins
|
|
|
|
| 15 |
|
| 16 |
with st.sidebar:
|
| 17 |
# system_promptSide = st.text_input("Optional system prompt:")
|
| 18 |
+
temperatureSide = st.slider("情感/Temperature", min_value=0.0, max_value=1.0, value=0.3, step=0.05)
|
| 19 |
max_new_tokensSide = st.slider("最大tokens生成数", min_value=0.0, max_value=4096.0, value=4096.0, step=64.0)
|
| 20 |
+
ToppSide = st.slider("Top-p (nucleus sampling)", min_value=0.0, max_value=1.0, value=0.6, step=0.05)
|
| 21 |
+
RepetitionpenaltySide = st.slider("Repetition penalty", min_value=0.0, max_value=2.0, value=1.2, step=0.05)
|
| 22 |
|
| 23 |
model_id = 'shaowenchen/baichuan2-7b-chat-gguf'
|
| 24 |
|
|
|
|
| 42 |
conversation_history = []
|
| 43 |
|
| 44 |
# Prediction function
|
| 45 |
+
def predict(message, system_prompt='', temperature=temperatureSide, max_new_tokens=max_new_tokensSide,Topp=ToppSide,Repetitionpenalty=RepetitionpenaltySide):
|
| 46 |
global conversation_history
|
| 47 |
question=message
|
| 48 |
input_text=ins
|