soojeongcrystal commited on
Commit
702c25c
β€’
1 Parent(s): 777fd1a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -73,15 +73,19 @@ def validate_and_get_columns(employee_df, program_df):
73
 
74
  return None, employee_cols, program_cols
75
 
76
- # 유튜브 데이터 μ—΄ 선택 ν•¨μˆ˜
77
  def select_youtube_columns(youtube_file):
78
  global youtube_columns
79
  youtube_df = pd.read_csv(youtube_file.name)
80
  required_youtube_cols = ["title", "description", "url", "upload_date"]
81
  youtube_columns = auto_match_columns(youtube_df, required_youtube_cols)
82
 
83
- column_options = {col: youtube_df.columns.tolist() for col in required_youtube_cols}
84
- return [gr.Dropdown.update(choices=youtube_df.columns.tolist(), value=youtube_columns.get(col, "")) for col in required_youtube_cols]
 
 
 
 
 
85
 
86
  # 유튜브 μ½˜ν…μΈ  데이터 λ‘œλ“œ 및 처리 ν•¨μˆ˜
87
  def load_youtube_content(file_path, title_col, description_col, url_col, upload_date_col):
 
73
 
74
  return None, employee_cols, program_cols
75
 
 
76
  def select_youtube_columns(youtube_file):
77
  global youtube_columns
78
  youtube_df = pd.read_csv(youtube_file.name)
79
  required_youtube_cols = ["title", "description", "url", "upload_date"]
80
  youtube_columns = auto_match_columns(youtube_df, required_youtube_cols)
81
 
82
+ column_options = youtube_df.columns.tolist()
83
+ return [
84
+ gr.Dropdown(choices=column_options, value=youtube_columns.get("title", "")),
85
+ gr.Dropdown(choices=column_options, value=youtube_columns.get("description", "")),
86
+ gr.Dropdown(choices=column_options, value=youtube_columns.get("url", "")),
87
+ gr.Dropdown(choices=column_options, value=youtube_columns.get("upload_date", ""))
88
+ ]
89
 
90
  # 유튜브 μ½˜ν…μΈ  데이터 λ‘œλ“œ 및 처리 ν•¨μˆ˜
91
  def load_youtube_content(file_path, title_col, description_col, url_col, upload_date_col):