Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -30,6 +30,7 @@ def predict(user_input):
|
|
30 |
if user_input == "Print_data_hmm":
|
31 |
with open("question_answer.json", "r") as file:
|
32 |
print(json.load(file))
|
|
|
33 |
return "Done"
|
34 |
else:
|
35 |
inputs = tokenizer(user_input, return_tensors="tf", padding=True, truncation=True)
|
@@ -47,6 +48,9 @@ def predict(user_input):
|
|
47 |
# Decode the response
|
48 |
response = tokenizer.decode(response_id[0], skip_special_tokens=True)
|
49 |
save_question(question = user_input,answer=response)
|
|
|
|
|
|
|
50 |
return response
|
51 |
|
52 |
# Gradio interface
|
|
|
30 |
if user_input == "Print_data_hmm":
|
31 |
with open("question_answer.json", "r") as file:
|
32 |
print(json.load(file))
|
33 |
+
print()
|
34 |
return "Done"
|
35 |
else:
|
36 |
inputs = tokenizer(user_input, return_tensors="tf", padding=True, truncation=True)
|
|
|
48 |
# Decode the response
|
49 |
response = tokenizer.decode(response_id[0], skip_special_tokens=True)
|
50 |
save_question(question = user_input,answer=response)
|
51 |
+
print("Q:",user_input)
|
52 |
+
print("A:",response)
|
53 |
+
print("T:",datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
|
54 |
return response
|
55 |
|
56 |
# Gradio interface
|