ssboost commited on
Commit
0eaf572
ยท
verified ยท
1 Parent(s): 9bdda18

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -7
app.py CHANGED
@@ -15,7 +15,7 @@ logger = logging.getLogger(__name__)
15
  # ์ด๋ฏธ์ง€ ์บ์‹œ
16
  IMAGE_CACHE = {}
17
 
18
- # CSS (์›๋ณธ ์Šคํƒ€์ผ ์œ ์ง€ + ์˜ˆ์‹œ ํฌ๊ธฐ ์ถ•์†Œ + ํ•˜๋‹จ ์—ฌ๋ฐฑ ์ œ๊ฑฐ)
19
  custom_css = """
20
  :root {
21
  --primary-color: #FB7F0D;
@@ -96,20 +96,25 @@ body {
96
  }
97
  footer { visibility: hidden; }
98
  .gradio-container {
99
- padding-bottom: 0px !important;
100
- margin-bottom: 0px !important;
101
  }
102
- .gr-block {
103
- margin-bottom: 0px !important;
 
 
 
 
104
  }
105
  """
106
 
107
- # FontAwesome ์•„์ด์ฝ˜ ๋งํฌ
108
  fontawesome_link = """
109
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
110
  """
111
 
112
  # ์ด๋ฏธ์ง€ ๋กœ๋“œ ๋ฐ ์บ์‹œ
 
113
  def load_image_cached(path):
114
  if path not in IMAGE_CACHE:
115
  try:
@@ -126,17 +131,20 @@ def load_image_cached(path):
126
  return IMAGE_CACHE[path]
127
 
128
  # ์˜ˆ์‹œ ๋ฏธ๋ฆฌ ๋กœ๋“œ
 
129
  def preload_example_images():
130
  for ex in product_background_examples:
131
  load_image_cached(ex[0])
132
  load_image_cached(ex[5])
133
 
134
  # ์˜ˆ์‹œ ์„ ํƒ ํ•ธ๋“ค๋Ÿฌ
 
135
  def load_example(evt: gr.SelectData):
136
  ex = product_background_examples[evt.index]
137
  return ex[0], ex[1], ex[2], ex[3], ex[4] or "(์—†์Œ)", ex[5]
138
 
139
  # ์ฒซ ๋ฒˆ์งธ ์˜ˆ์‹œ ์ž๋™ ๋กœ๋“œ
 
140
  def load_first_example():
141
  if product_background_examples:
142
  ex = product_background_examples[0]
@@ -144,6 +152,7 @@ def load_first_example():
144
  return None, "", "", "", "", None
145
 
146
  # Gradio ์•ฑ ์ƒ์„ฑ
 
147
  def create_app():
148
  with gr.Blocks(css=custom_css, theme=gr.themes.Default(
149
  primary_hue="orange", secondary_hue="orange",
 
15
  # ์ด๋ฏธ์ง€ ์บ์‹œ
16
  IMAGE_CACHE = {}
17
 
18
+ # CSS (์›๋ณธ ์Šคํƒ€์ผ ์œ ์ง€ + ์˜ˆ์‹œ ํฌ๊ธฐ ์ถ•์†Œ)
19
  custom_css = """
20
  :root {
21
  --primary-color: #FB7F0D;
 
96
  }
97
  footer { visibility: hidden; }
98
  .gradio-container {
99
+ padding-bottom: 0 !important;
100
+ margin-bottom: 0 !important;
101
  }
102
+ .gr-block, .gr-row, .gr-column {
103
+ margin: 0 !important;
104
+ padding: 0 !important;
105
+ }
106
+ html, body, .gradio-container, .gr-block, .gr-row, .gr-column {
107
+ height: auto !important;
108
  }
109
  """
110
 
111
+ # ์•„์ด์ฝ˜ ๋งํฌ
112
  fontawesome_link = """
113
+ <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\" />
114
  """
115
 
116
  # ์ด๋ฏธ์ง€ ๋กœ๋“œ ๋ฐ ์บ์‹œ
117
+
118
  def load_image_cached(path):
119
  if path not in IMAGE_CACHE:
120
  try:
 
131
  return IMAGE_CACHE[path]
132
 
133
  # ์˜ˆ์‹œ ๋ฏธ๋ฆฌ ๋กœ๋“œ
134
+
135
  def preload_example_images():
136
  for ex in product_background_examples:
137
  load_image_cached(ex[0])
138
  load_image_cached(ex[5])
139
 
140
  # ์˜ˆ์‹œ ์„ ํƒ ํ•ธ๋“ค๋Ÿฌ
141
+
142
  def load_example(evt: gr.SelectData):
143
  ex = product_background_examples[evt.index]
144
  return ex[0], ex[1], ex[2], ex[3], ex[4] or "(์—†์Œ)", ex[5]
145
 
146
  # ์ฒซ ๋ฒˆ์งธ ์˜ˆ์‹œ ์ž๋™ ๋กœ๋“œ
147
+
148
  def load_first_example():
149
  if product_background_examples:
150
  ex = product_background_examples[0]
 
152
  return None, "", "", "", "", None
153
 
154
  # Gradio ์•ฑ ์ƒ์„ฑ
155
+
156
  def create_app():
157
  with gr.Blocks(css=custom_css, theme=gr.themes.Default(
158
  primary_hue="orange", secondary_hue="orange",