Illia56 commited on
Commit
8713e85
1 Parent(s): 13ab025

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -18,11 +18,11 @@ This Space demonstrates model [Llama-2-70b-chat-hf](https://huggingface.co/meta-
18
 
19
 
20
  with st.sidebar:
21
- # system_promptSide = st.text_input("Optional system prompt:")
22
  temperatureSide = st.slider("Temperature", min_value=0.0, max_value=1.0, value=0.9, step=0.05)
23
  max_new_tokensSide = st.slider("Max new tokens", min_value=0.0, max_value=4096.0, value=4096.0, step=64.0)
24
- # ToppSide = st.slider("Top-p (nucleus sampling)", min_value=0.0, max_value=1.0, value=0.6, step=0.05)
25
- # RepetitionpenaltySide = st.slider("Repetition penalty", min_value=0.0, max_value=2.0, value=1.2, step=0.05)
26
 
27
  whisper_client = Client("https://sanchit-gandhi-whisper-large-v2.hf.space/")
28
 
@@ -100,7 +100,7 @@ if prompt := textinput:
100
  # Add user message to chat history
101
  st.session_state.messages.append({"role": "human", "content": prompt})
102
 
103
- response = predict(message=prompt)#, temperature= temperatureSide,max_new_tokens=max_new_tokensSide)
104
  # Display assistant response in chat message container
105
  with st.chat_message("assistant", avatar='🦙'):
106
  st.markdown(response)
 
18
 
19
 
20
  with st.sidebar:
21
+ system_promptSide = st.text_input("Optional system prompt:")
22
  temperatureSide = st.slider("Temperature", min_value=0.0, max_value=1.0, value=0.9, step=0.05)
23
  max_new_tokensSide = st.slider("Max new tokens", min_value=0.0, max_value=4096.0, value=4096.0, step=64.0)
24
+ ToppSide = st.slider("Top-p (nucleus sampling)", min_value=0.0, max_value=1.0, value=0.6, step=0.05)
25
+ RepetitionpenaltySide = st.slider("Repetition penalty", min_value=0.0, max_value=2.0, value=1.2, step=0.05)
26
 
27
  whisper_client = Client("https://sanchit-gandhi-whisper-large-v2.hf.space/")
28
 
 
100
  # Add user message to chat history
101
  st.session_state.messages.append({"role": "human", "content": prompt})
102
 
103
+ response = predict(message=prompt, temperature= temperatureSide,max_new_tokens=max_new_tokensSide, Topp=ToppSide,Repetitionpenalty=RepetitionpenaltySide)
104
  # Display assistant response in chat message container
105
  with st.chat_message("assistant", avatar='🦙'):
106
  st.markdown(response)