Spaces:
Running
Running
ayan4m1
commited on
Commit
·
d5731ac
1
Parent(s):
db30c0a
fix: remove top-k sampling
Browse files
app.py
CHANGED
@@ -12,8 +12,7 @@ def respond(
|
|
12 |
history: list[tuple[str, str]],
|
13 |
max_tokens: int,
|
14 |
temperature: float,
|
15 |
-
top_p: float
|
16 |
-
top_k: int
|
17 |
):
|
18 |
messages = []
|
19 |
|
@@ -32,8 +31,7 @@ def respond(
|
|
32 |
max_tokens=max_tokens,
|
33 |
stream=True,
|
34 |
temperature=temperature,
|
35 |
-
top_p=top_p
|
36 |
-
top_k=top_k
|
37 |
):
|
38 |
token = message.choices[0].delta.content
|
39 |
|
@@ -56,13 +54,6 @@ demo = gr.ChatInterface(
|
|
56 |
step=0.05,
|
57 |
label="Top-p",
|
58 |
),
|
59 |
-
gr.Slider(
|
60 |
-
minimum=10,
|
61 |
-
maximum=100,
|
62 |
-
value=30,
|
63 |
-
step=10,
|
64 |
-
label="Top-k"
|
65 |
-
),
|
66 |
],
|
67 |
)
|
68 |
|
|
|
12 |
history: list[tuple[str, str]],
|
13 |
max_tokens: int,
|
14 |
temperature: float,
|
15 |
+
top_p: float
|
|
|
16 |
):
|
17 |
messages = []
|
18 |
|
|
|
31 |
max_tokens=max_tokens,
|
32 |
stream=True,
|
33 |
temperature=temperature,
|
34 |
+
top_p=top_p
|
|
|
35 |
):
|
36 |
token = message.choices[0].delta.content
|
37 |
|
|
|
54 |
step=0.05,
|
55 |
label="Top-p",
|
56 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
],
|
58 |
)
|
59 |
|