ryanrwatkins commited on
Commit
f4dee1b
1 Parent(s): 8d49bec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -37,7 +37,7 @@ prompts_archive_url = "https://huggingface.co/datasets/ryanrwatkins/na_prompts_a
37
  prompts_archive_file_name = "prompts_archives.csv"
38
  prompts_archive_file = os.path.join("prompts_archive", prompts_archive_file_name)
39
 
40
- HF_TOKEN = os.environ.get("HF_TOKEN")
41
  repo = Repository(
42
  local_dir="prompts_archive", clone_from=prompts_archive_url, use_auth_token=HF_TOKEN
43
  )
@@ -96,13 +96,13 @@ def submit_message(prompt, prompt_template, temperature, max_tokens, context_len
96
 
97
 
98
 
99
- # with open(prompts_archive_file, "a") as csvfile:
100
- # writer = csv.DictWriter(csvfile, fieldnames=["prompt", "time"])
101
- # writer.writerow(
102
- # {"prompt": str(prompt), "time": str(datetime.now())}
103
- # )
104
- # commit_url = repo.push_to_hub()
105
- # print(commit_url)
106
 
107
  system_prompt = []
108
  if prompt_template:
 
37
  prompts_archive_file_name = "prompts_archives.csv"
38
  prompts_archive_file = os.path.join("prompts_archive", prompts_archive_file_name)
39
 
40
+ HF_TOKEN = os.environ.get("HF_token_write")
41
  repo = Repository(
42
  local_dir="prompts_archive", clone_from=prompts_archive_url, use_auth_token=HF_TOKEN
43
  )
 
96
 
97
 
98
 
99
+ with open(prompts_archive_file, "a") as csvfile:
100
+ writer = csv.DictWriter(csvfile, fieldnames=["prompt", "time"])
101
+ writer.writerow(
102
+ {"prompt": str(prompt), "time": str(datetime.now())}
103
+ )
104
+ commit_url = repo.push_to_hub()
105
+ print(commit_url)
106
 
107
  system_prompt = []
108
  if prompt_template: