Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -16,18 +16,13 @@ def format_prompt(message, history):
|
|
16 |
return prompt
|
17 |
|
18 |
def generate(
|
19 |
-
prompt, history, system_prompt, max_new_tokens=100, temperature=0.7, repetition_penalty=1.2, top_p=0.95, top_k=1,
|
20 |
):
|
21 |
temperature = float(temperature)
|
22 |
if temperature < 1e-2:
|
23 |
temperature = 1e-2
|
24 |
top_p = float(top_p)
|
25 |
|
26 |
-
if random_seed:
|
27 |
-
seed = random.randint(1, 100000)
|
28 |
-
else:
|
29 |
-
seed = manual_seed
|
30 |
-
|
31 |
generate_kwargs = dict(
|
32 |
temperature=temperature,
|
33 |
max_new_tokens=max_new_tokens,
|
@@ -98,11 +93,6 @@ additional_inputs=[
|
|
98 |
interactive=True,
|
99 |
info="Higher k means more diverse outputs by considering a range of tokens",
|
100 |
),
|
101 |
-
gr.Checkbox(
|
102 |
-
label="Use Random Seed",
|
103 |
-
value=False,
|
104 |
-
info="Use a random starting point to initiate the generation process instead of the manual one"
|
105 |
-
),
|
106 |
gr.Number(
|
107 |
label="Manual Seed",
|
108 |
value=42,
|
|
|
16 |
return prompt
|
17 |
|
18 |
def generate(
|
19 |
+
prompt, history, system_prompt, max_new_tokens=100, temperature=0.7, repetition_penalty=1.2, top_p=0.95, top_k=1, seed=42,
|
20 |
):
|
21 |
temperature = float(temperature)
|
22 |
if temperature < 1e-2:
|
23 |
temperature = 1e-2
|
24 |
top_p = float(top_p)
|
25 |
|
|
|
|
|
|
|
|
|
|
|
26 |
generate_kwargs = dict(
|
27 |
temperature=temperature,
|
28 |
max_new_tokens=max_new_tokens,
|
|
|
93 |
interactive=True,
|
94 |
info="Higher k means more diverse outputs by considering a range of tokens",
|
95 |
),
|
|
|
|
|
|
|
|
|
|
|
96 |
gr.Number(
|
97 |
label="Manual Seed",
|
98 |
value=42,
|