tatihden commited on
Commit
3992653
·
verified ·
1 Parent(s): e82a433

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -30,8 +30,8 @@ def format_prompt(message, history):
30
 
31
 
32
  def chat_inf(system_prompt, prompt, history, temp, tokens, top_p, seed, client_choice):
33
- #client = clients[int(client_choice) - 1]
34
- client = clients[(client_choice)]
35
  if not history:
36
  history = []
37
  hist_len = 0
@@ -39,7 +39,7 @@ def chat_inf(system_prompt, prompt, history, temp, tokens, top_p, seed, client_c
39
  hist_len = len(history)
40
  print(hist_len)
41
 
42
- sampler = keras_nlp.samplers.TopKSampler(k=5, seed=seed, top_p=top_p, temperature=temp)
43
  client.compile(sampler=sampler)
44
 
45
  formatted_prompt = format_prompt(f"{system_prompt}, {prompt}", history)
 
30
 
31
 
32
  def chat_inf(system_prompt, prompt, history, temp, tokens, top_p, seed, client_choice):
33
+ client = clients[int(client_choice) - 1]
34
+
35
  if not history:
36
  history = []
37
  hist_len = 0
 
39
  hist_len = len(history)
40
  print(hist_len)
41
 
42
+ sampler = keras_hub.samplers.TopKSampler(k=5, seed=seed, top_p=top_p, temperature=temp)
43
  client.compile(sampler=sampler)
44
 
45
  formatted_prompt = format_prompt(f"{system_prompt}, {prompt}", history)