AIRider commited on
Commit
12216f2
Β·
verified Β·
1 Parent(s): 26c78a4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -53,7 +53,7 @@ def get_channel_stats(channel_id):
53
 
54
  if channel_response["items"]:
55
  channel = channel_response["items"][0]
56
- subscriber_count = int(channel["statistics"]["subscriberCount"])
57
  else:
58
  subscriber_count = 0
59
 
@@ -134,7 +134,8 @@ def analyze_titles(video_stats_df, n_clusters=5):
134
  return cluster_summary_df
135
 
136
  def summarize_cluster(cluster_text, cluster_num):
137
- response = client(inputs=cluster_text)
 
138
  summary = response[0]['generated_text'].strip()
139
  return summary
140
 
 
53
 
54
  if channel_response["items"]:
55
  channel = channel_response["items"][0]
56
+ subscriber_count = int(channel["statistics"].get("subscriberCount"))
57
  else:
58
  subscriber_count = 0
59
 
 
134
  return cluster_summary_df
135
 
136
  def summarize_cluster(cluster_text, cluster_num):
137
+ prompt = f"λ‹€μŒ λ™μ˜μƒμ„ λΆ„μ„ν•˜μ—¬ μš”μ•½ν•˜κ³ , 500자 μ΄λ‚΄λ‘œ λ™μ˜μƒμ˜ νŠΉμ§• 및 인기 μš”μΈμ„ μ„€λͺ…ν•΄μ£Όμ„Έμš”: {cluster_text}"
138
+ response = client(inputs=prompt)
139
  summary = response[0]['generated_text'].strip()
140
  return summary
141