gpucce commited on
Commit
75fa23c
1 Parent(s): 0b4f2a5

type error

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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.5,
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)",