Staticaliza commited on
Commit
1a1d724
1 Parent(s): caf7748

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -15,6 +15,8 @@ DEFAULT_INPUT = f"User: Hi!"
15
  DEFAULT_PREOUTPUT = f"Statical: "
16
  DEFAULT_INSTRUCTION = "Statical is a helpful chatbot who is communicating with people."
17
 
 
 
18
  API_ENDPOINTS = {
19
  "Falcon": "tiiuae/falcon-180B-chat",
20
  "Llama": "meta-llama/Llama-2-70b-chat-hf"
@@ -43,6 +45,7 @@ def predict(instruction, history, input, preoutput, access_key, model, temperatu
43
  history = history or []
44
  input = input or ""
45
  preoutput = preoutput or ""
 
46
 
47
  stops = json.loads(stop_seqs)
48
 
@@ -107,7 +110,7 @@ with gr.Blocks() as demo:
107
  top_k = gr.Slider( minimum = 1, maximum = 2048, value = 50, step = 1, interactive = True, label = "Top K" )
108
  rep_p = gr.Slider( minimum = 0.01, maximum = 2, value = 1.2, step = 0.01, interactive = True, label = "Repetition Penalty" )
109
  max_tokens = gr.Slider( minimum = 1, maximum = 2048, value = 32, step = 64, interactive = True, label = "Max New Tokens" )
110
- stop_seqs = gr.Textbox(label = "Stop Sequences ( JSON Array / 4 Max )", lines = 1, value = '["‹", "›"]')
111
  seed = gr.Slider( minimum = 0, maximum = 8192, value = 42, step = 1, interactive = True, label = "Seed" )
112
 
113
  with gr.Row():
 
15
  DEFAULT_PREOUTPUT = f"Statical: "
16
  DEFAULT_INSTRUCTION = "Statical is a helpful chatbot who is communicating with people."
17
 
18
+ DEFAULT_STOPS = '["‹", "›"]'
19
+
20
  API_ENDPOINTS = {
21
  "Falcon": "tiiuae/falcon-180B-chat",
22
  "Llama": "meta-llama/Llama-2-70b-chat-hf"
 
45
  history = history or []
46
  input = input or ""
47
  preoutput = preoutput or ""
48
+ stop_seqs = stop_seqs or DEFAULT_STOPS
49
 
50
  stops = json.loads(stop_seqs)
51
 
 
110
  top_k = gr.Slider( minimum = 1, maximum = 2048, value = 50, step = 1, interactive = True, label = "Top K" )
111
  rep_p = gr.Slider( minimum = 0.01, maximum = 2, value = 1.2, step = 0.01, interactive = True, label = "Repetition Penalty" )
112
  max_tokens = gr.Slider( minimum = 1, maximum = 2048, value = 32, step = 64, interactive = True, label = "Max New Tokens" )
113
+ stop_seqs = gr.Textbox(label = "Stop Sequences ( JSON Array / 4 Max )", lines = 1, value = DEFAULT_STOPS )
114
  seed = gr.Slider( minimum = 0, maximum = 8192, value = 42, step = 1, interactive = True, label = "Seed" )
115
 
116
  with gr.Row():