Deepak Sahu commited on
Commit
e60054b
·
1 Parent(s): b2ed780

reverse card style

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -60,7 +60,6 @@ def get_recommendation(book_title: str) -> dict:
60
 
61
  # return response
62
  # Generate card-style HTML
63
-
64
  html = "<div style='display: flex; flex-wrap: wrap; gap: 1rem;'>"
65
  for book, summary in zip(books, summaries):
66
  html += f"""
@@ -72,7 +71,7 @@ def get_recommendation(book_title: str) -> dict:
72
  html += "</div>"
73
 
74
  # Club the output to be processed by gradio
75
- response = [label_similarity, html]
76
 
77
  return response
78
 
@@ -83,7 +82,7 @@ def get_recommendation(book_title: str) -> dict:
83
  textbox = gr.Textbox(label="Write random title", placeholder="The Man who knew", lines=2)
84
  # label = gr.Label(label="Result", num_top_classes=N_RECOMMENDS)
85
  # output = [gr.Label(label="Result", num_top_classes=N_RECOMMENDS)] + [gr.Textbox(label="Recommendation") for i in range(N_RECOMMENDS)]
86
- output = [gr.Label(label="Similarity"), gr.HTML(label="Books Descriptions")]
87
  demo = gr.Interface(fn=get_recommendation, inputs=textbox, outputs=output)
88
 
89
  demo.launch()
 
60
 
61
  # return response
62
  # Generate card-style HTML
 
63
  html = "<div style='display: flex; flex-wrap: wrap; gap: 1rem;'>"
64
  for book, summary in zip(books, summaries):
65
  html += f"""
 
71
  html += "</div>"
72
 
73
  # Club the output to be processed by gradio
74
+ response = [label_similarity, ] #html]
75
 
76
  return response
77
 
 
82
  textbox = gr.Textbox(label="Write random title", placeholder="The Man who knew", lines=2)
83
  # label = gr.Label(label="Result", num_top_classes=N_RECOMMENDS)
84
  # output = [gr.Label(label="Result", num_top_classes=N_RECOMMENDS)] + [gr.Textbox(label="Recommendation") for i in range(N_RECOMMENDS)]
85
+ output = [gr.Label(label="Similarity"), ] # gr.HTML(label="Books Descriptions")]
86
  demo = gr.Interface(fn=get_recommendation, inputs=textbox, outputs=output)
87
 
88
  demo.launch()