Omnibus commited on
Commit
536027d
·
verified ·
1 Parent(s): a971d1a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -4
app.py CHANGED
@@ -15,10 +15,11 @@ from prompts import (
15
  COMPRESS_DATA_PROMPT_SMALL,
16
  PREFIX,
17
  )
18
- api=HfApi()
19
- client = InferenceClient(
20
- "mistralai/Mixtral-8x7B-Instruct-v0.1"
21
- )
 
22
 
23
  def parse_action(string: str):
24
  print("PARSING:")
@@ -283,6 +284,21 @@ def find_rss():
283
  print(f'Exception::{ea.keys()}')
284
 
285
  out_box.append(lod)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  yield out_box,[(None,'Sources are loaded. You can ask a question about them now.')]
287
 
288
  with gr.Blocks() as app:
 
15
  COMPRESS_DATA_PROMPT_SMALL,
16
  PREFIX,
17
  )
18
+ client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
19
+ save_data='https://huggingface.co/datasets/Omnibus/tmp1/raw/main/'
20
+ token_self = os.environ['HF_TOKEN']
21
+ api=HfApi(token=token_self)
22
+
23
 
24
  def parse_action(string: str):
25
  print("PARSING:")
 
284
  print(f'Exception::{ea.keys()}')
285
 
286
  out_box.append(lod)
287
+
288
+ #user_repo=save_data.split('datasets/',1)[1].split('/raw',1)[0]
289
+ timestamp=str(datetime.datetime.now())
290
+ timename=timestamp.replace(" ","--").replace(":","-").replace(".","-")
291
+
292
+ json_object = json.dumps(out_box, indent=4)
293
+ with open("tmp1.json", "w") as outfile:
294
+ outfile.write(json_object)
295
+ api.upload_file(
296
+ path_or_fileobj="tmp1.json",
297
+ path_in_repo=f"{timename}.json",
298
+ repo_id=save_data.split('datasets/',1)[1].split('/raw',1)[0],
299
+ token=token_self,
300
+ repo_type="dataset",
301
+ )
302
  yield out_box,[(None,'Sources are loaded. You can ask a question about them now.')]
303
 
304
  with gr.Blocks() as app: