Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,8 @@ import random
|
|
8 |
import json
|
9 |
import datetime
|
10 |
import xmltodict
|
|
|
|
|
11 |
|
12 |
from prompts import (
|
13 |
GET_KEYWORD,
|
@@ -20,7 +22,7 @@ from prompts import (
|
|
20 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
21 |
reponame="Omnibus/tmp"
|
22 |
save_data=f'https://huggingface.co/datasets/{reponame}/raw/main/'
|
23 |
-
token_self = os.environ['
|
24 |
api=HfApi(token=token_self)
|
25 |
|
26 |
|
@@ -313,7 +315,7 @@ def find_rss():
|
|
313 |
out_box=[]
|
314 |
valid_box=[]
|
315 |
yield [],[(None,"loading sources")],None
|
316 |
-
with open ('
|
317 |
cont = json.loads(j.read())
|
318 |
#print(cont)
|
319 |
j.close()
|
@@ -391,6 +393,7 @@ def find_rss():
|
|
391 |
error_box.append({"Name":rss_url,"Error":e,"Error Code":6})
|
392 |
print(f'Exception::{e}')
|
393 |
pass
|
|
|
394 |
json_object_valid = json.dumps(valid_box, indent=4)
|
395 |
with open("tmp3.json", "w") as outfile3:
|
396 |
outfile3.write(json_object_valid)
|
@@ -403,10 +406,7 @@ def find_rss():
|
|
403 |
repo_type="dataset",
|
404 |
)
|
405 |
yield out_box,[(None,'')],error_box
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
print("DONE")
|
411 |
json_object = json.dumps(out_box, indent=4)
|
412 |
#json_object = json.dumps(out_box,indent=4)
|
|
|
8 |
import json
|
9 |
import datetime
|
10 |
import xmltodict
|
11 |
+
from textblob import TextBlob
|
12 |
+
|
13 |
|
14 |
from prompts import (
|
15 |
GET_KEYWORD,
|
|
|
22 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
23 |
reponame="Omnibus/tmp"
|
24 |
save_data=f'https://huggingface.co/datasets/{reponame}/raw/main/'
|
25 |
+
token_self = os.environ['HF_TOKEN2']
|
26 |
api=HfApi(token=token_self)
|
27 |
|
28 |
|
|
|
315 |
out_box=[]
|
316 |
valid_box=[]
|
317 |
yield [],[(None,"loading sources")],None
|
318 |
+
with open ('valid_feeds.json','r') as j:
|
319 |
cont = json.loads(j.read())
|
320 |
#print(cont)
|
321 |
j.close()
|
|
|
393 |
error_box.append({"Name":rss_url,"Error":e,"Error Code":6})
|
394 |
print(f'Exception::{e}')
|
395 |
pass
|
396 |
+
'''
|
397 |
json_object_valid = json.dumps(valid_box, indent=4)
|
398 |
with open("tmp3.json", "w") as outfile3:
|
399 |
outfile3.write(json_object_valid)
|
|
|
406 |
repo_type="dataset",
|
407 |
)
|
408 |
yield out_box,[(None,'')],error_box
|
409 |
+
'''
|
|
|
|
|
|
|
410 |
print("DONE")
|
411 |
json_object = json.dumps(out_box, indent=4)
|
412 |
#json_object = json.dumps(out_box,indent=4)
|