WICKED4950 commited on
Commit
a3bf946
·
verified ·
1 Parent(s): 4d2cd9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -12,14 +12,11 @@ with strategy.scope():
12
  model = TFBlenderbotForConditionalGeneration.from_pretrained(model_name)
13
 
14
  def save_question(question,answer,path = "question_answer.json"):
15
- try:
16
- with open(path, "r") as file:
17
- data = json.load(file)
18
- data.append({"Question:":question,"Answer:":answer})
19
- with open(path, "w") as file:
20
- json.dump(data, file, indent=4)
21
- except Exception as e:
22
- print(f"Error with {e}")
23
 
24
  print("Interface getting done....")
25
  # Define the chatbot function
 
12
  model = TFBlenderbotForConditionalGeneration.from_pretrained(model_name)
13
 
14
  def save_question(question,answer,path = "question_answer.json"):
15
+ with open(path, "r") as file:
16
+ data = json.load(file)
17
+ data.append({"Question:":question,"Answer:":answer})
18
+ with open(path, "w") as file:
19
+ json.dump(data, file, indent=4)
 
 
 
20
 
21
  print("Interface getting done....")
22
  # Define the chatbot function