mgreg555 commited on
Commit
277e13c
·
verified ·
1 Parent(s): 71a8ec9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -92,16 +92,16 @@ def chat(query,history):
92
  import gradio as gr
93
  from huggingface_hub import HfFileSystem
94
 
95
- #fs = HfFileSystem(token=os.environ.get('DATASE_ACCES'))
96
 
97
  def write_to_file(file_name,content):
98
  file_path = f"datasets/mgreg555/samu_reference_book/" + file_name
99
- # with fs.open(file_path, "r") as file_old:
100
- # content_old = file_old.read()
101
- # print(content_old)
102
 
103
- # with fs.open(file_path, "w") as file:
104
- # file.write(f"{content_old}\n" + content)
105
 
106
  # Example usage
107
 
 
92
  import gradio as gr
93
  from huggingface_hub import HfFileSystem
94
 
95
+ fs = HfFileSystem(token=os.environ.get('DATASET_ACCES'))
96
 
97
  def write_to_file(file_name,content):
98
  file_path = f"datasets/mgreg555/samu_reference_book/" + file_name
99
+ with fs.open(file_path, "r") as file_old:
100
+ content_old = file_old.read()
101
+ print(content_old)
102
 
103
+ with fs.open(file_path, "w") as file:
104
+ file.write(f"{content_old}\n" + content)
105
 
106
  # Example usage
107