Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ YOUTUBE_API_KEY = "YOUR_YOUTUBE_API_KEY"
|
|
15 |
|
16 |
def create_client(model_name):
|
17 |
token = os.getenv("HF_TOKEN")
|
18 |
-
return InferenceClient(model_name, token=token)
|
19 |
|
20 |
client = create_client("CohereForAI/c4ai-command-r-plus")
|
21 |
|
@@ -135,7 +135,7 @@ def analyze_titles(video_stats_df, n_clusters=5):
|
|
135 |
|
136 |
def summarize_cluster(cluster_text, cluster_num):
|
137 |
response = client(inputs=cluster_text)
|
138 |
-
summary = response[
|
139 |
return summary
|
140 |
|
141 |
def main(query, max_results, period, page, n_clusters=5):
|
|
|
15 |
|
16 |
def create_client(model_name):
|
17 |
token = os.getenv("HF_TOKEN")
|
18 |
+
return InferenceClient(model_name=model_name, token=token)
|
19 |
|
20 |
client = create_client("CohereForAI/c4ai-command-r-plus")
|
21 |
|
|
|
135 |
|
136 |
def summarize_cluster(cluster_text, cluster_num):
|
137 |
response = client(inputs=cluster_text)
|
138 |
+
summary = response['generated_text'].strip()
|
139 |
return summary
|
140 |
|
141 |
def main(query, max_results, period, page, n_clusters=5):
|