kimhyunwoo commited on
Commit
1be6da6
ยท
verified ยท
1 Parent(s): c7c787a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +92 -82
app.py CHANGED
@@ -1,31 +1,23 @@
1
  import gradio as gr
2
  import torch
3
  import os
4
- from transformers import AutoTokenizer
5
- from optimum.onnxruntime import ORTModelForCausalLM
6
 
7
  # --- Configuration ---
8
- # ์‚ฌ์šฉ์ž๋‹˜์ด ์ง€์ •ํ•œ ONNX ๋ชจ๋ธ ID
9
- MODEL_ID = "onnx-community/gemma-3-1b-it-ONNX-GQA"
10
- # ์–‘์žํ™”๋œ ๋ชจ๋ธ ํŒŒ์ผ ์ด๋ฆ„ (์ €์žฅ์†Œ ๊ตฌ์กฐ ํ™•์ธ ํ•„์š”, ์—†์„ ๊ฒฝ์šฐ ์ผ๋ฐ˜ ๋ชจ๋ธ ์‹œ๋„)
11
- # Q4 ๋ชจ๋ธ ํŒŒ์ผ์ด 'onnx/model_q4.onnx' ํ˜•ํƒœ์ผ ์ˆ˜ ์žˆ์Œ -> optimum ์ด ์ž๋™ ๊ฐ์ง€ ์‹œ๋„
12
- # ์šฐ์„  ๋ช…์‹œ์  ํŒŒ์ผ ์ง€์ • ์—†์ด ๋กœ๋“œ ์‹œ๋„
13
- ONNX_FILE_NAME = None # e.g., "onnx/model_q4.onnx" if needed and present
14
 
15
- # Hugging Face Hub ํ† ํฐ (ํ•„์š”์‹œ - Gemma ๋ชจ๋ธ์€ Gated์ผ ์ˆ˜ ์žˆ์œผ๋‚˜ ONNX ์ปค๋ฎค๋‹ˆํ‹ฐ ๋ฒ„์ „์€ ์•„๋‹ ์ˆ˜ ์žˆ์Œ)
16
- # HF_TOKEN = os.getenv("HF_TOKEN") # Space secrets ์—์„œ ์„ค์ •
 
17
 
18
  # --- Device Selection ---
19
  try:
20
  if torch.cuda.is_available():
21
  device = "cuda:0"
22
  provider = "CUDAExecutionProvider"
23
- print("Using GPU (CUDA).")
24
- # Mps (Apple Silicon) - Gradio Spaces ์—์„œ๋Š” ์‚ฌ์šฉ ๋ถˆ๊ฐ€ ๊ฐ€๋Šฅ์„ฑ ๋†’์Œ
25
- # elif torch.backends.mps.is_available():
26
- # device = "mps"
27
- # provider = "CoreMLExecutionProvider" # Needs check
28
- # print("Using MPS (Apple Silicon).")
29
  else:
30
  device = "cpu"
31
  provider = "CPUExecutionProvider"
@@ -36,132 +28,150 @@ except Exception as e:
36
  provider = "CPUExecutionProvider"
37
 
38
  # --- Model and Tokenizer Loading ---
 
 
 
 
39
  print(f"Attempting to load model: {MODEL_ID}")
40
  print(f"Using device: {device}, Execution Provider: {provider}")
41
 
42
  try:
43
- # ํ† ํฌ๋‚˜์ด์ € ๋กœ๋“œ
44
- tokenizer = AutoTokenizer.from_pretrained(MODEL_ID) #, token=HF_TOKEN)
45
  print("Tokenizer loaded successfully.")
46
 
47
- # ONNX ๋ชจ๋ธ ๋กœ๋“œ (Optimum ์‚ฌ์šฉ)
48
- # provider_options ์„ค์ • (ํ•„์š”์‹œ ์ถ”๊ฐ€ ์ตœ์ ํ™” ๊ฐ€๋Šฅ)
49
  model = ORTModelForCausalLM.from_pretrained(
50
  MODEL_ID,
51
- # filename=ONNX_FILE_NAME, # ํŒŒ์ผ๋ช… ๋ช…์‹œ๊ฐ€ ํ•„์š” ์—†์„ ์ˆ˜ ์žˆ์Œ (์ž๋™ ๊ฐ์ง€)
52
  provider=provider,
53
- # use_auth_token=HF_TOKEN, # Gated ๋ชจ๋ธ์ผ ๊ฒฝ์šฐ ํ•„์š”
54
  use_cache=True, # KV ์บ์‹œ ์‚ฌ์šฉ
55
- # provider_options={'enable_skip_layer_norm_strict_mode': True} # ์˜ˆ์‹œ ์˜ต์…˜
56
  )
57
- # ๋ชจ๋ธ์„ ์ง€์ •๋œ ๋””๋ฐ”์ด์Šค๋กœ ์ด๋™ (ORTModel ์€ ๋‚ด๋ถ€์ ์œผ๋กœ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ์œผ๋‚˜ ๋ช…์‹œ ๊ฐ€๋Šฅ)
58
- # model.to(device) # ORTModel ์—์„œ๋Š” .to() ๊ฐ€ ์—†์„ ์ˆ˜ ์žˆ์Œ, provider ์ง€์ •์œผ๋กœ ์ฒ˜๋ฆฌ
59
  print(f"ONNX Model '{MODEL_ID}' loaded successfully with provider '{provider}'.")
60
  model_loaded_successfully = True
61
 
 
 
 
 
 
 
 
 
 
 
 
62
  except Exception as e:
63
- print(f"!!!!!!!!!!!!!! Error loading model {MODEL_ID} !!!!!!!!!!!!!!")
 
 
64
  print(f"Error type: {type(e).__name__}")
65
  print(f"Error message: {e}")
66
- print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
 
67
  model_loaded_successfully = False
68
- # ๋ชจ๋ธ ๋กœ๋”ฉ ์‹คํŒจ ์‹œ Gradio ์•ฑ ์‹คํ–‰ ์ค‘๋‹จ ๋˜๋Š” ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€ ํ‘œ์‹œ
69
- # raise gr.Error(f"CRITICAL: Failed to load model '{MODEL_ID}'. Check logs. Error: {e}")
70
 
71
  # --- Chat Function ---
72
  def chat_function(message: str, history: list):
73
- if not model_loaded_successfully:
74
- return "Error: The AI model failed to load. Cannot generate response."
 
75
 
76
- # Gemma Instruct ํ˜•์‹์— ๋งž๊ฒŒ history ์™€ message ๋ฅผ ํ”„๋กฌํ”„ํŠธ๋กœ ๋ณ€ํ™˜
77
- # AutoTokenizer ์— chat_template ์ด ์ •์˜๋˜์–ด ์žˆ์œผ๋ฉด ์‚ฌ์šฉ ๊ถŒ์žฅ
78
  try:
79
- # [[user_msg1, model_msg1], ...] -> [{"role": "user", "content": ...}, ...]
80
  chat_messages = [{"role": "system", "content": "You are a helpful AI assistant."}]
81
  for user_msg, model_msg in history:
82
- chat_messages.append({"role": "user", "content": user_msg})
83
- chat_messages.append({"role": "model", "content": model_msg})
84
- chat_messages.append({"role": "user", "content": message})
85
-
86
- # ํ† ํฌ๋‚˜์ด์ €์˜ apply_chat_template ์‚ฌ์šฉ (Gemma ์ง€์› ํ™•์ธ ํ•„์š”)
 
 
 
 
 
87
  try:
88
  prompt = tokenizer.apply_chat_template(
89
  chat_messages,
90
  tokenize=False,
91
- add_generation_prompt=True # ๋ชจ๋ธ์ด ์‘๋‹ต์„ ์‹œ์ž‘ํ•˜๋„๋ก ํ”„๋กฌํ”„ํŠธ ์ถ”๊ฐ€
92
  )
93
  except Exception as template_error:
94
- # ํ…œํ”Œ๋ฆฟ ์ ์šฉ ์‹คํŒจ ์‹œ ์ˆ˜๋™ ๊ตฌ์„ฑ (์ด์ „ JS ๋ฒ„์ „ ๋ฐฉ์‹)
95
- print(f"Warning: Failed to apply chat template ({template_error}). Falling back to manual prompt construction.")
96
  prompt_parts = ["<start_of_turn>system\nYou are a helpful AI assistant.<end_of_turn>"]
 
97
  for user_msg, model_msg in history:
98
- prompt_parts.append(f"<start_of_turn>user\n{user_msg}<end_of_turn>")
99
- prompt_parts.append(f"<start_of_turn>model\n{model_msg}<end_of_turn>")
100
- prompt_parts.append(f"<start_of_turn>user\n{message}<end_of_turn>")
101
  prompt_parts.append("<start_of_turn>model")
102
  prompt = "\n".join(prompt_parts)
103
 
 
104
 
105
- # print("\n--- Prompt ---")
106
- # print(prompt)
107
- # print("--------------\n")
108
-
109
- # ์ž…๋ ฅ ํ† ํฐํ™”
110
- inputs = tokenizer(prompt, return_tensors="pt").to(device) # ๋ชจ๋ธ๊ณผ ๊ฐ™์€ ๋””๋ฐ”์ด์Šค๋กœ
111
 
112
  # ์‘๋‹ต ์ƒ์„ฑ
113
  print("Generating response...")
114
- outputs = model.generate(
115
- **inputs,
116
- max_new_tokens=512,
117
- do_sample=True,
118
- temperature=0.7,
119
- top_k=50,
120
- top_p=0.9,
121
- # pad_token_id=tokenizer.eos_token_id # ํŒจ๋”ฉ ์„ค์ • ํ•„์š”์‹œ
122
- )
 
123
  print("Generation complete.")
124
 
125
- # ์ƒ์„ฑ๋œ ํ† ํฐ ๋””์ฝ”๋”ฉ (์ž…๋ ฅ ๋ถ€๋ถ„ ์ œ์™ธ)
126
- # inputs[0] ๋Œ€์‹  inputs['input_ids'][0] ์‚ฌ์šฉํ•ด์•ผ ํ•  ์ˆ˜ ์žˆ์Œ
127
  input_token_len = inputs['input_ids'].shape[1]
128
  generated_tokens = outputs[0][input_token_len:]
129
  response = tokenizer.decode(generated_tokens, skip_special_tokens=True)
130
 
131
- # ์ข…๋ฃŒ ํ† ํฐ ๋˜๋Š” ๋ถˆํ•„์š”ํ•œ ํ›„ํ–‰ ํ…์ŠคํŠธ ์ œ๊ฑฐ
132
  response = response.replace("<end_of_turn>", "").strip()
133
 
134
- # print("\n--- Response ---")
135
- # print(response)
136
- # print("--------------\n")
 
 
 
137
 
138
- # history.append((message, response)) # history ๋Š” Gradio ๊ฐ€ ๊ด€๋ฆฌ
139
  return response
140
 
141
  except Exception as e:
142
- print(f"Error during generation: {e}")
143
- # ์‚ฌ์šฉ์ž์—๊ฒŒ ํ‘œ์‹œ๋  ์ˆ˜ ์žˆ๋Š” ์•ˆ์ „ํ•œ ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€ ๋ฐ˜ํ™˜
144
- return f"Sorry, an error occurred during response generation. Please check the application logs for details."
 
 
 
 
145
 
146
 
147
- # --- Gradio Interface ---
148
  print("Creating Gradio Interface...")
149
  iface = gr.ChatInterface(
150
- fn=chat_function if model_loaded_successfully else lambda msg, hist: "Model not loaded.", # ๋ชจ๋ธ ๋กœ๋“œ ์‹คํŒจ์‹œ ๋Œ€์ฒด ํ•จ์ˆ˜
151
- title="AI Assistant (Gemma 3 1B ONNX)",
152
  description=f"Chat with {MODEL_ID}. Model loaded: {model_loaded_successfully}",
153
- chatbot=gr.Chatbot(height=600),
154
- textbox=gr.Textbox(placeholder="Ask me anything...", container=False, scale=7),
155
- submit_btn="Send",
156
- retry_btn="Retry",
157
- undo_btn="Undo",
158
- clear_btn="Clear",
159
- theme=gr.themes.Soft(), # ํ…Œ๋งˆ ์ ์šฉ
 
160
  examples=[["Hello!"], ["Write a poem about the internet."]]
161
  )
162
 
163
  # --- Launch App ---
164
  if __name__ == "__main__":
165
  print("Launching Gradio App...")
166
- # share=True ๋กœ ์„ค์ •ํ•˜๋ฉด ์™ธ๋ถ€์—์„œ ์ ‘๊ทผ ๊ฐ€๋Šฅํ•œ ๋งํฌ ์ƒ์„ฑ (๋ณด์•ˆ ์ฃผ์˜)
167
- iface.launch()#share=True)
 
1
  import gradio as gr
2
  import torch
3
  import os
4
+ from transformers import AutoTokenizer, __version__ as transformers_version # ๋ฒ„์ „ ํ™•์ธ์šฉ import ์ถ”๊ฐ€
5
+ from optimum.onnxruntime import ORTModelForCausalLM, __version__ as optimum_version # ๋ฒ„์ „ ํ™•์ธ์šฉ import ์ถ”๊ฐ€
6
 
7
  # --- Configuration ---
8
+ MODEL_ID = "onnx-community/gemma-3-1b-it-ONNX-GQA" # ์‚ฌ์šฉ์ž๊ฐ€ ์ง€์ •ํ•œ GQA ๋ชจ๋ธ
9
+ ONNX_FILE_NAME = None # ํŒŒ์ผ๋ช… ์ž๋™ ๊ฐ์ง€ ์‹œ๋„
 
 
 
 
10
 
11
+ print(f"Using Transformers version: {transformers_version}")
12
+ print(f"Using Optimum version: {optimum_version}")
13
+ print(f"Using Gradio version: {gr.__version__}") # Gradio ๋ฒ„์ „ ๋กœ๊น…
14
 
15
  # --- Device Selection ---
16
  try:
17
  if torch.cuda.is_available():
18
  device = "cuda:0"
19
  provider = "CUDAExecutionProvider"
20
+ print("Attempting to use GPU (CUDA).")
 
 
 
 
 
21
  else:
22
  device = "cpu"
23
  provider = "CPUExecutionProvider"
 
28
  provider = "CPUExecutionProvider"
29
 
30
  # --- Model and Tokenizer Loading ---
31
+ model = None
32
+ tokenizer = None
33
+ model_loaded_successfully = False
34
+
35
  print(f"Attempting to load model: {MODEL_ID}")
36
  print(f"Using device: {device}, Execution Provider: {provider}")
37
 
38
  try:
39
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
 
40
  print("Tokenizer loaded successfully.")
41
 
42
+ # ONNX ๋ชจ๋ธ ๋กœ๋“œ ์‹œ๋„
 
43
  model = ORTModelForCausalLM.from_pretrained(
44
  MODEL_ID,
 
45
  provider=provider,
 
46
  use_cache=True, # KV ์บ์‹œ ์‚ฌ์šฉ
47
+ # use_io_binding=False # GPU ์‚ฌ์šฉ ์‹œ ๋ฌธ์ œ ๋ฐœ์ƒํ•˜๋ฉด False ๋กœ ์‹œ๋„
48
  )
 
 
49
  print(f"ONNX Model '{MODEL_ID}' loaded successfully with provider '{provider}'.")
50
  model_loaded_successfully = True
51
 
52
+ except ValueError as ve:
53
+ # ValueError ๋Š” ๋ชจ๋ธ ํƒ€์ž… ๋ฏธ์ง€์› ์˜ค๋ฅ˜์ผ ๊ฐ€๋Šฅ์„ฑ์ด ๋†’์Œ
54
+ print(f"!!!!!!!!!!!!!! CRITICAL MODEL LOADING ERROR (ValueError) !!!!!!!!!!!!!!")
55
+ print(f"Model: {MODEL_ID}")
56
+ print(f"Error message: {ve}")
57
+ print("This likely means the installed 'transformers' library version does NOT support the 'gemma3_text' architecture.")
58
+ print("Ensure 'requirements.txt' specifies a recent version (e.g., transformers>=4.41.0) and the Space has been rebuilt/restarted.")
59
+ print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
60
+ # ๋ชจ๋ธ ๋กœ๋”ฉ ์‹คํŒจ ์‹œ ์‚ฌ์šฉ์ž์—๊ฒŒ ๋ช…ํ™•ํžˆ ์•Œ๋ฆผ
61
+ model_loaded_successfully = False
62
+
63
  except Exception as e:
64
+ # ๋‹ค๋ฅธ ์ข…๋ฅ˜์˜ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ (๋ฉ”๋ชจ๋ฆฌ ๋ถ€์กฑ, ๋„คํŠธ์›Œํฌ ๋“ฑ)
65
+ print(f"!!!!!!!!!!!!!! UNEXPECTED MODEL LOADING ERROR !!!!!!!!!!!!!!")
66
+ print(f"Model: {MODEL_ID}")
67
  print(f"Error type: {type(e).__name__}")
68
  print(f"Error message: {e}")
69
+ print("Check Space resources (memory limits), network connection, or other dependencies.")
70
+ print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
71
  model_loaded_successfully = False
 
 
72
 
73
  # --- Chat Function ---
74
  def chat_function(message: str, history: list):
75
+ if not model_loaded_successfully or model is None or tokenizer is None:
76
+ # ๋ชจ๋ธ ๋กœ๋“œ ์‹คํŒจ ์‹œ ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€ ๋ฐ˜ํ™˜
77
+ return "Error: The AI model is not loaded. Please check the application logs."
78
 
 
 
79
  try:
80
+ # ์ฑ„ํŒ… ๊ธฐ๋ก์„ messages ํ˜•์‹์œผ๋กœ ๋ณ€ํ™˜
81
  chat_messages = [{"role": "system", "content": "You are a helpful AI assistant."}]
82
  for user_msg, model_msg in history:
83
+ # None ๊ฐ’ ์ฒดํฌ ์ถ”๊ฐ€ (Gradio ์ดˆ๊ธฐ ์ƒํƒœ ๋“ฑ์—์„œ ๋ฐœ์ƒ ๊ฐ€๋Šฅ)
84
+ if user_msg:
85
+ chat_messages.append({"role": "user", "content": user_msg})
86
+ if model_msg:
87
+ chat_messages.append({"role": "model", "content": model_msg})
88
+ if message: # ํ˜„์žฌ ์‚ฌ์šฉ์ž ๋ฉ”์‹œ์ง€ ์ถ”๊ฐ€
89
+ chat_messages.append({"role": "user", "content": message})
90
+
91
+ # ํ”„๋กฌํ”„ํŠธ ์ƒ์„ฑ (apply_chat_template ์‹œ๋„, ์‹คํŒจ ์‹œ ์ˆ˜๋™)
92
+ prompt = ""
93
  try:
94
  prompt = tokenizer.apply_chat_template(
95
  chat_messages,
96
  tokenize=False,
97
+ add_generation_prompt=True
98
  )
99
  except Exception as template_error:
100
+ print(f"Warning: Failed to apply chat template ({template_error}). Using manual prompt construction.")
 
101
  prompt_parts = ["<start_of_turn>system\nYou are a helpful AI assistant.<end_of_turn>"]
102
+ # history ์—์„œ model ๋ฉ”์‹œ์ง€๊ฐ€ None ์ผ ์ˆ˜ ์žˆ์Œ์— ์œ ์˜
103
  for user_msg, model_msg in history:
104
+ if user_msg: prompt_parts.append(f"<start_of_turn>user\n{user_msg}<end_of_turn>")
105
+ if model_msg: prompt_parts.append(f"<start_of_turn>model\n{model_msg}<end_of_turn>")
106
+ if message: prompt_parts.append(f"<start_of_turn>user\n{message}<end_of_turn>")
107
  prompt_parts.append("<start_of_turn>model")
108
  prompt = "\n".join(prompt_parts)
109
 
110
+ # print(f"--- PROMPT --- \n{prompt}\n--------------")
111
 
112
+ # ์ž…๋ ฅ ํ† ํฐํ™” ๋ฐ ๋””๋ฐ”์ด์Šค ์ด๋™
113
+ inputs = tokenizer(prompt, return_tensors="pt").to(device)
 
 
 
 
114
 
115
  # ์‘๋‹ต ์ƒ์„ฑ
116
  print("Generating response...")
117
+ with torch.no_grad(): # ์ถ”๋ก  ์‹œ ๊ทธ๋ž˜๋””์–ธํŠธ ๊ณ„์‚ฐ ๋น„ํ™œ์„ฑํ™”
118
+ outputs = model.generate(
119
+ **inputs,
120
+ max_new_tokens=512,
121
+ do_sample=True,
122
+ temperature=0.7,
123
+ top_k=50,
124
+ top_p=0.9,
125
+ pad_token_id=tokenizer.eos_token_id # EOS ํ† ํฐ์„ ํŒจ๋”ฉ ํ† ํฐ์œผ๋กœ ์‚ฌ์šฉ
126
+ )
127
  print("Generation complete.")
128
 
129
+ # ๋””์ฝ”๋”ฉ (์ž…๋ ฅ ๋ถ€๋ถ„ ์ œ์™ธ)
 
130
  input_token_len = inputs['input_ids'].shape[1]
131
  generated_tokens = outputs[0][input_token_len:]
132
  response = tokenizer.decode(generated_tokens, skip_special_tokens=True)
133
 
134
+ # ํ›„์ฒ˜๋ฆฌ
135
  response = response.replace("<end_of_turn>", "").strip()
136
 
137
+ # print(f"--- RESPONSE --- \n{response}\n--------------")
138
+
139
+ # ๋นˆ ์‘๋‹ต ์ฒ˜๋ฆฌ
140
+ if not response:
141
+ print("Warning: Generated empty response.")
142
+ response = "Sorry, I couldn't generate a response for that."
143
 
 
144
  return response
145
 
146
  except Exception as e:
147
+ print(f"!!!!!!!!!!!!!! Error during generation !!!!!!!!!!!!!!")
148
+ print(f"Error type: {type(e).__name__}")
149
+ print(f"Error message: {e}")
150
+ print("Input message:", message)
151
+ # traceback.print_exc() # ํ•„์š”์‹œ ์ƒ์„ธ ํŠธ๋ ˆ์ด์Šค๋ฐฑ ์ถœ๋ ฅ
152
+ print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
153
+ return f"Sorry, an error occurred during response generation. Please check logs."
154
 
155
 
156
+ # --- Gradio Interface (์ˆ˜์ •๋จ) ---
157
  print("Creating Gradio Interface...")
158
  iface = gr.ChatInterface(
159
+ fn=chat_function, # ๋ชจ๋ธ ๋กœ๋“œ ์‹คํŒจ ์‹œ chat_function ๋‚ด๋ถ€์—์„œ ์ฒ˜๋ฆฌ
160
+ title="AI Assistant (Gemma 3 1B ONNX-GQA)",
161
  description=f"Chat with {MODEL_ID}. Model loaded: {model_loaded_successfully}",
162
+ # chatbot ์œ„์ ฏ์— type='messages' ์ถ”๊ฐ€
163
+ chatbot=gr.Chatbot(height=600, type="messages", bubble_full_width=False),
164
+ # ์ง€์›ํ•˜์ง€ ์•Š๋Š” ๋ฒ„ํŠผ ์ธ์ž ์ œ๊ฑฐ
165
+ # retry_btn=None, # ์ œ๊ฑฐ
166
+ # undo_btn=None, # ์ œ๊ฑฐ
167
+ # clear_btn=None, # ์ œ๊ฑฐ
168
+ # submit_btn ๋Œ€์‹  ๊ธฐ๋ณธ ๋ฒ„ํŠผ ์‚ฌ์šฉ
169
+ theme=gr.themes.Soft(),
170
  examples=[["Hello!"], ["Write a poem about the internet."]]
171
  )
172
 
173
  # --- Launch App ---
174
  if __name__ == "__main__":
175
  print("Launching Gradio App...")
176
+ # ๋ชจ๋ธ ๋กœ๋”ฉ ์‹คํŒจ ์‹œ์—๋„ ์ธํ„ฐํŽ˜์ด์Šค๋Š” ์‹คํ–‰ํ•˜๋˜, ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€ ํ‘œ์‹œ
177
+ iface.launch()