Pedro Cuenca commited on
Commit
a61d80f
1 Parent(s): 704ee93

Fix the number of candidates reported.

Browse files

Remove unused function.


Former-commit-id: 56477d17106201597ed12671d6f3c64f2d01ee84

Files changed (1) hide show
  1. app/app_gradio_ngrok.py +1 -6
app/app_gradio_ngrok.py CHANGED
@@ -24,11 +24,6 @@ def compose_predictions(images, caption=None):
24
  draw.text((20, 3), caption, (255,255,255), font=font)
25
  return img
26
 
27
- def top_k_predictions(prompt, num_candidates=32, k=8):
28
- images = hallucinate(prompt, num_images=num_candidates)
29
- images = clip_top_k(prompt, images, k=k)
30
- return images
31
-
32
  class ServiceError(Exception):
33
  def __init__(self, status_code):
34
  self.status_code = status_code
@@ -51,7 +46,7 @@ def run_inference(prompt):
51
  predictions = compose_predictions(images)
52
  output_title = f"""
53
  <p style="font-size:22px; font-style:bold">Best predictions</p>
54
- <p>We asked our model to generate 32 candidates for your prompt:</p>
55
 
56
  <pre>
57
 
 
24
  draw.text((20, 3), caption, (255,255,255), font=font)
25
  return img
26
 
 
 
 
 
 
27
  class ServiceError(Exception):
28
  def __init__(self, status_code):
29
  self.status_code = status_code
 
46
  predictions = compose_predictions(images)
47
  output_title = f"""
48
  <p style="font-size:22px; font-style:bold">Best predictions</p>
49
+ <p>We asked our model to generate 128 candidates for your prompt:</p>
50
 
51
  <pre>
52