Tillmandev commited on
Commit
014b32e
·
1 Parent(s): f74656f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -17,6 +17,7 @@ with st.sidebar:
17
  max_new_tokensSide = st.slider("Max new tokens", min_value=0.0, max_value=4096.0, value=4096.0, step=64.0)
18
  ToppSide = st.slider("Top-p (nucleus sampling)", min_value=0.0, max_value=1.0, value=0.6, step=0.05)
19
  RepetitionpenaltySide = st.slider("Repetition penalty", min_value=0.0, max_value=2.0, value=1.2, step=0.05)
 
20
 
21
  whisper_client = Client("https://sanchit-gandhi-whisper-large-v2.hf.space/")
22
 
@@ -30,7 +31,7 @@ def transcribe(wav_path):
30
  )
31
 
32
  # Prediction function
33
- def predict(message, system_prompt='', temperature=0.7, max_new_tokens=4096,Topp=0.5,Repetitionpenalty=1.2):
34
  with st.status("Starting client"):
35
  client = Client("https://huggingface-projects-llama-2-7b-chat.hf.space/--replicas/gm5p8/")
36
  st.write("Requesting client")
@@ -42,6 +43,7 @@ def predict(message, system_prompt='', temperature=0.7, max_new_tokens=4096,Topp
42
  temperature, # int | float (numeric value between 0.0 and 1.0)
43
  max_new_tokens, # int | float (numeric value between 0 and 4096)
44
  Topp, # int | float (numeric value between 0.0 and 1)
 
45
  Repetitionpenalty, # int | float (numeric value between 1.0 and 2.0)
46
  api_name="/chat"
47
  )
@@ -64,7 +66,7 @@ for message in st.session_state.messages:
64
  with st.chat_message(message["role"], avatar=("🧑‍💻" if message["role"] == 'human' else '🦙')):
65
  st.markdown(message["content"])
66
 
67
- textinput = st.chat_input("Ask LLama-2-70b anything...")
68
  wav_audio_data = st_audiorec()
69
 
70
  if wav_audio_data != None:
 
17
  max_new_tokensSide = st.slider("Max new tokens", min_value=0.0, max_value=4096.0, value=4096.0, step=64.0)
18
  ToppSide = st.slider("Top-p (nucleus sampling)", min_value=0.0, max_value=1.0, value=0.6, step=0.05)
19
  RepetitionpenaltySide = st.slider("Repetition penalty", min_value=0.0, max_value=2.0, value=1.2, step=0.05)
20
+ topk = st.slider("TOP K", min_value=1.0, max_value=1000.0, value=150, step=0.05)
21
 
22
  whisper_client = Client("https://sanchit-gandhi-whisper-large-v2.hf.space/")
23
 
 
31
  )
32
 
33
  # Prediction function
34
+ def predict(message, system_prompt='', max_new_tokens=2048, temperature=0.7, Topp=0.5, topk=150, Repetitionpenalty=1.2):
35
  with st.status("Starting client"):
36
  client = Client("https://huggingface-projects-llama-2-7b-chat.hf.space/--replicas/gm5p8/")
37
  st.write("Requesting client")
 
43
  temperature, # int | float (numeric value between 0.0 and 1.0)
44
  max_new_tokens, # int | float (numeric value between 0 and 4096)
45
  Topp, # int | float (numeric value between 0.0 and 1)
46
+ topk, # int | float (numeric value between 1 and 1000) in 'Top-k' Slider component
47
  Repetitionpenalty, # int | float (numeric value between 1.0 and 2.0)
48
  api_name="/chat"
49
  )
 
66
  with st.chat_message(message["role"], avatar=("🧑‍💻" if message["role"] == 'human' else '🦙')):
67
  st.markdown(message["content"])
68
 
69
+ textinput = st.chat_input("Ask LLama-2-7b anything...")
70
  wav_audio_data = st_audiorec()
71
 
72
  if wav_audio_data != None: