Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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")
|