Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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"]
|
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 |
-
|
|
|
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 |
|