ssboost commited on
Commit
9bdda18
ยท
verified ยท
1 Parent(s): 76c3b57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -8
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;
@@ -95,15 +95,21 @@ body {
95
  padding: 0;
96
  }
97
  footer { visibility: hidden; }
 
 
 
 
 
 
 
98
  """
99
 
100
- # ์•„์ด์ฝ˜ ๋งํฌ
101
  fontawesome_link = """
102
- <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\" />
103
  """
104
 
105
  # ์ด๋ฏธ์ง€ ๋กœ๋“œ ๋ฐ ์บ์‹œ
106
-
107
  def load_image_cached(path):
108
  if path not in IMAGE_CACHE:
109
  try:
@@ -120,20 +126,17 @@ def load_image_cached(path):
120
  return IMAGE_CACHE[path]
121
 
122
  # ์˜ˆ์‹œ ๋ฏธ๋ฆฌ ๋กœ๋“œ
123
-
124
  def preload_example_images():
125
  for ex in product_background_examples:
126
  load_image_cached(ex[0])
127
  load_image_cached(ex[5])
128
 
129
  # ์˜ˆ์‹œ ์„ ํƒ ํ•ธ๋“ค๋Ÿฌ
130
-
131
  def load_example(evt: gr.SelectData):
132
  ex = product_background_examples[evt.index]
133
  return ex[0], ex[1], ex[2], ex[3], ex[4] or "(์—†์Œ)", ex[5]
134
 
135
  # ์ฒซ ๋ฒˆ์งธ ์˜ˆ์‹œ ์ž๋™ ๋กœ๋“œ
136
-
137
  def load_first_example():
138
  if product_background_examples:
139
  ex = product_background_examples[0]
@@ -141,7 +144,6 @@ def load_first_example():
141
  return None, "", "", "", "", None
142
 
143
  # Gradio ์•ฑ ์ƒ์„ฑ
144
-
145
  def create_app():
146
  with gr.Blocks(css=custom_css, theme=gr.themes.Default(
147
  primary_hue="orange", secondary_hue="orange",
 
15
  # ์ด๋ฏธ์ง€ ์บ์‹œ
16
  IMAGE_CACHE = {}
17
 
18
+ # CSS (์›๋ณธ ์Šคํƒ€์ผ ์œ ์ง€ + ์˜ˆ์‹œ ํฌ๊ธฐ ์ถ•์†Œ + ํ•˜๋‹จ ์—ฌ๋ฐฑ ์ œ๊ฑฐ)
19
  custom_css = """
20
  :root {
21
  --primary-color: #FB7F0D;
 
95
  padding: 0;
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
  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
  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",