Spaces:
Running
on
T4
Running
on
T4
type error
Browse files
app.py
CHANGED
@@ -32,10 +32,10 @@ def inference_caption(image, decoding_method="Beam search", rep_penalty=1.2, top
|
|
32 |
generated = model.generate(
|
33 |
im,
|
34 |
generation_type=generation_type,
|
35 |
-
top_p=top_p,
|
36 |
min_seq_len=min_seq_len,
|
37 |
seq_len=seq_len,
|
38 |
-
repetition_penalty=rep_penalty
|
39 |
)
|
40 |
return open_clip.decode(generated[0].detach()).split("<end_of_text>")[0].replace("<start_of_text>", "")
|
41 |
|
@@ -61,7 +61,7 @@ with gr.Blocks() as iface:
|
|
61 |
rep_penalty = gr.Slider(
|
62 |
minimum=1.0,
|
63 |
maximum=5.0,
|
64 |
-
value=1.
|
65 |
step=0.5,
|
66 |
interactive=True,
|
67 |
label="Repeat Penalty (larger value prevents repetition)",
|
|
|
32 |
generated = model.generate(
|
33 |
im,
|
34 |
generation_type=generation_type,
|
35 |
+
top_p=float(top_p),
|
36 |
min_seq_len=min_seq_len,
|
37 |
seq_len=seq_len,
|
38 |
+
repetition_penalty=float(rep_penalty)
|
39 |
)
|
40 |
return open_clip.decode(generated[0].detach()).split("<end_of_text>")[0].replace("<start_of_text>", "")
|
41 |
|
|
|
61 |
rep_penalty = gr.Slider(
|
62 |
minimum=1.0,
|
63 |
maximum=5.0,
|
64 |
+
value=1.0,
|
65 |
step=0.5,
|
66 |
interactive=True,
|
67 |
label="Repeat Penalty (larger value prevents repetition)",
|