Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,7 @@ import asyncprawcore
|
|
10 |
import schedule
|
11 |
import time
|
12 |
import shutil
|
|
|
13 |
|
14 |
from pathlib import Path
|
15 |
from typing import List, Dict, Any
|
@@ -63,7 +64,7 @@ async def main():
|
|
63 |
results["Num subreddits after using keywords filter"] = sum([len(company_subreddits) for company_subreddits in subreddits_to_include.values()])
|
64 |
|
65 |
# -- Pass new subreddits through classifier to determien if they are technology related --
|
66 |
-
topic_classifier_client = InferenceClient(model="gulnuravci/subreddit_description_topic_classifier", token=HF_TOKEN_READ)
|
67 |
|
68 |
# key is the parent company and the value is a list of subreddit objects that are technology related
|
69 |
subreddits_passed_topic_classifier = defaultdict(list)
|
@@ -136,7 +137,7 @@ async def main():
|
|
136 |
API_URL = "https://wk6x4kfrdikhsi0n.us-east-1.aws.endpoints.huggingface.cloud"
|
137 |
headers = {
|
138 |
"Accept" : "application/json",
|
139 |
-
"Authorization": "Bearer " + HF_TOKEN_READ,
|
140 |
"Content-Type": "application/json"
|
141 |
}
|
142 |
|
|
|
10 |
import schedule
|
11 |
import time
|
12 |
import shutil
|
13 |
+
import os
|
14 |
|
15 |
from pathlib import Path
|
16 |
from typing import List, Dict, Any
|
|
|
64 |
results["Num subreddits after using keywords filter"] = sum([len(company_subreddits) for company_subreddits in subreddits_to_include.values()])
|
65 |
|
66 |
# -- Pass new subreddits through classifier to determien if they are technology related --
|
67 |
+
topic_classifier_client = InferenceClient(model="gulnuravci/subreddit_description_topic_classifier", token=os.getenv("HF_TOKEN_READ"))
|
68 |
|
69 |
# key is the parent company and the value is a list of subreddit objects that are technology related
|
70 |
subreddits_passed_topic_classifier = defaultdict(list)
|
|
|
137 |
API_URL = "https://wk6x4kfrdikhsi0n.us-east-1.aws.endpoints.huggingface.cloud"
|
138 |
headers = {
|
139 |
"Accept" : "application/json",
|
140 |
+
"Authorization": "Bearer " + os.getenv("HF_TOKEN_READ"),
|
141 |
"Content-Type": "application/json"
|
142 |
}
|
143 |
|