nadish1210 commited on
Commit
b716ebb
Β·
verified Β·
1 Parent(s): 3f6250b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -1,11 +1,11 @@
1
- # app.py
2
  import gradio as gr
3
  from model import (
4
  images_to_pdf,
5
  merge_pdfs,
6
  compress_pdf,
7
  save_feedback,
8
- show_feedback
 
9
  )
10
 
11
  css = """
@@ -14,7 +14,8 @@ css = """
14
  .reset-btn {background-color:red !important; color:white !important;}
15
  """
16
 
17
- with gr.Blocks(css=css, title="Its Nadish - Image to PDF") as demo:
 
18
  gr.HTML('<div class="title">Its Nadish</div>')
19
  gr.Markdown("### Powerful Image to PDF | Merge | Compress Tool")
20
 
@@ -49,7 +50,7 @@ with gr.Blocks(css=css, title="Its Nadish - Image to PDF") as demo:
49
  with gr.TabItem("πŸ“‰ Compress PDF"):
50
  comp_file = gr.File(file_types=[".pdf"], label="Upload PDF")
51
  comp_lvl = gr.Dropdown(
52
- list(compression_map.keys()), # compression_map model.py se aa raha hai
53
  value="Balanced (Good Quality + Small Size)",
54
  label="Compression Level"
55
  )
@@ -109,12 +110,10 @@ with gr.Blocks(css=css, title="Its Nadish - Image to PDF") as demo:
109
  img_msg, comb_msg, comp_msg, comp_table, f_msg]
110
  )
111
 
112
- # app.py ke sabse last mein yeh rakho (purana wala replace kar do)
113
-
114
  if __name__ == "__main__":
115
  demo.launch(
116
- # server_name="0.0.0.0", # optional (commented ok)
117
- # server_port=7860, # optional (commented ok)
118
  share=False,
119
  ssr_mode=False
120
  )
 
 
1
  import gradio as gr
2
  from model import (
3
  images_to_pdf,
4
  merge_pdfs,
5
  compress_pdf,
6
  save_feedback,
7
+ show_feedback,
8
+ compression_map # βœ… FIX: yeh add kiya
9
  )
10
 
11
  css = """
 
14
  .reset-btn {background-color:red !important; color:white !important;}
15
  """
16
 
17
+ # ❌ css yahan se hata diya (Gradio 6 fix)
18
+ with gr.Blocks(title="Its Nadish - Image to PDF") as demo:
19
  gr.HTML('<div class="title">Its Nadish</div>')
20
  gr.Markdown("### Powerful Image to PDF | Merge | Compress Tool")
21
 
 
50
  with gr.TabItem("πŸ“‰ Compress PDF"):
51
  comp_file = gr.File(file_types=[".pdf"], label="Upload PDF")
52
  comp_lvl = gr.Dropdown(
53
+ list(compression_map.keys()), # βœ… ab error nahi ayega
54
  value="Balanced (Good Quality + Small Size)",
55
  label="Compression Level"
56
  )
 
110
  img_msg, comb_msg, comp_msg, comp_table, f_msg]
111
  )
112
 
113
+ # βœ… launch me css shift kiya (Gradio 6 fix)
 
114
  if __name__ == "__main__":
115
  demo.launch(
116
+ css=css,
 
117
  share=False,
118
  ssr_mode=False
119
  )