WICKED4950 commited on
Commit
5a80cec
·
verified ·
1 Parent(s): ecc2e9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -11,14 +11,12 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
11
  with strategy.scope():
12
  model = TFBlenderbotForConditionalGeneration.from_pretrained(model_name)
13
 
14
- with open("question_answer.json", "r") as file:
15
- data = json.load(file)
16
-
17
  print(data)
18
  def save_question(question,answer,path = "question_answer.json"):
19
  with open(path, "r") as file:
20
  data = json.load(file)
21
  data["Interactions"].append({"Question:":question,"Answer:":answer})
 
22
  with open(path, "w") as file:
23
  json.dump(data, file, indent=4)
24
  print("saving question")
 
11
  with strategy.scope():
12
  model = TFBlenderbotForConditionalGeneration.from_pretrained(model_name)
13
 
 
 
 
14
  print(data)
15
  def save_question(question,answer,path = "question_answer.json"):
16
  with open(path, "r") as file:
17
  data = json.load(file)
18
  data["Interactions"].append({"Question:":question,"Answer:":answer})
19
+ print(data)
20
  with open(path, "w") as file:
21
  json.dump(data, file, indent=4)
22
  print("saving question")