FDSRashid commited on
Commit
454fe7a
·
verified ·
1 Parent(s): 6575a44

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -17,7 +17,13 @@ books.loc[:, 'book_type'] = books['book_type'].apply(lambda x: x.replace('"', ''
17
  books.loc[:, 'Book_Name'] = books['Book_Name'].apply(lambda x: x.replace('"', ''))
18
  books.loc[:, 'Author'] = books['Author'].apply(lambda x: x.replace('"', ''))
19
  books = books.drop(columns = ['field5', 'field6', 'field7', 'field8'])
 
 
 
 
 
20
 
 
21
 
22
  def book_retriever(name):
23
  if 'ALL' in name:
@@ -27,7 +33,7 @@ def book_retriever(name):
27
  return books[(books['Book_Name'].apply(lambda x: araby.strip_diacritics(x)).str.contains(araby.strip_diacritics(name), regex=True)) | (books['Author'].apply(lambda x: araby.strip_diacritics(x)).str.contains(araby.strip_diacritics(name), regex=True)) | (books['Book_ID'].astype(str).isin(full_names.split('|')))]
28
 
29
 
30
- with gr.Blocks() as demo:
31
  text_input = gr.Textbox()
32
  text_output = gr.DataFrame(wrap=True)
33
  text_button = gr.Button("Search")
 
17
  books.loc[:, 'Book_Name'] = books['Book_Name'].apply(lambda x: x.replace('"', ''))
18
  books.loc[:, 'Author'] = books['Author'].apply(lambda x: x.replace('"', ''))
19
  books = books.drop(columns = ['field5', 'field6', 'field7', 'field8'])
20
+ css = """
21
+ .table-wrap {
22
+ min-height: 600px;
23
+ max-height: 600px;
24
+ }
25
 
26
+ """
27
 
28
  def book_retriever(name):
29
  if 'ALL' in name:
 
33
  return books[(books['Book_Name'].apply(lambda x: araby.strip_diacritics(x)).str.contains(araby.strip_diacritics(name), regex=True)) | (books['Author'].apply(lambda x: araby.strip_diacritics(x)).str.contains(araby.strip_diacritics(name), regex=True)) | (books['Book_ID'].astype(str).isin(full_names.split('|')))]
34
 
35
 
36
+ with gr.Blocks(css=css) as demo:
37
  text_input = gr.Textbox()
38
  text_output = gr.DataFrame(wrap=True)
39
  text_button = gr.Button("Search")