Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
34 |
-
|
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 =
|
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)
|