WICKED4950 commited on
Commit
7016690
·
verified ·
1 Parent(s): 9115b30

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -9,6 +9,7 @@ data = {"Interactions":[]}
9
  with open("question_answer.json", "w") as file:
10
  json.dump(data, file, indent=4)
11
 
 
12
  print("Loading the model......")
13
  model_name = "WICKED4950/Irisonego5"
14
  strategy = tf.distribute.MirroredStrategy()
@@ -21,6 +22,7 @@ def save_question(question,answer,path = "question_answer.json"):
21
  with open(path, "r") as file:
22
  data = json.load(file)
23
  data["Interactions"].append({"Question:":question,"Answer:":answer,"Time:":datetime.now().strftime("%Y-%m-%d %H:%M:%S")})
 
24
  with open(path, "w") as file:
25
  json.dump(data, file, indent=4)
26
 
@@ -29,6 +31,7 @@ print("Interface getting done....")
29
  def predict(user_input):
30
  if user_input == "Print_data_hmm":
31
  print(json.dumps(data, indent=4))
 
32
  return "Done"
33
  else:
34
  inputs = tokenizer(user_input, return_tensors="tf", padding=True, truncation=True)
 
9
  with open("question_answer.json", "w") as file:
10
  json.dump(data, file, indent=4)
11
 
12
+ print(f"at start {data}")
13
  print("Loading the model......")
14
  model_name = "WICKED4950/Irisonego5"
15
  strategy = tf.distribute.MirroredStrategy()
 
22
  with open(path, "r") as file:
23
  data = json.load(file)
24
  data["Interactions"].append({"Question:":question,"Answer:":answer,"Time:":datetime.now().strftime("%Y-%m-%d %H:%M:%S")})
25
+ print(f"saving and now {data}")
26
  with open(path, "w") as file:
27
  json.dump(data, file, indent=4)
28
 
 
31
  def predict(user_input):
32
  if user_input == "Print_data_hmm":
33
  print(json.dumps(data, indent=4))
34
+ print(f"at printing {data}")
35
  return "Done"
36
  else:
37
  inputs = tokenizer(user_input, return_tensors="tf", padding=True, truncation=True)