Spaces:
Sleeping
Sleeping
Zekun Wu
commited on
Commit
•
54ff1eb
1
Parent(s):
63782e9
add
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ client = AzureOpenAI(azure_endpoint="https://personality-service.openai.azure.co
|
|
13 |
TOKEN = os.getenv('hf_token')
|
14 |
def store_feedback(user_input, response, feedback, rating,repo):
|
15 |
dataset = load_dataset(repo, token=TOKEN, download_mode="force_redownload", ignore_verifications=True)
|
16 |
-
new_entry = pd.DataFrame({"user_input": [user_input], "response": [response], "feedback": [feedback], "
|
17 |
new_dataset = Dataset.from_pandas(new_entry)
|
18 |
updated_dataset = concatenate_datasets([dataset["train"], new_dataset])
|
19 |
updated_dataset.push_to_hub(repo, private=False, token=TOKEN)
|
|
|
13 |
TOKEN = os.getenv('hf_token')
|
14 |
def store_feedback(user_input, response, feedback, rating,repo):
|
15 |
dataset = load_dataset(repo, token=TOKEN, download_mode="force_redownload", ignore_verifications=True)
|
16 |
+
new_entry = pd.DataFrame({"user_input": [user_input], "response": [response], "feedback": [feedback], "rate": [rating]})
|
17 |
new_dataset = Dataset.from_pandas(new_entry)
|
18 |
updated_dataset = concatenate_datasets([dataset["train"], new_dataset])
|
19 |
updated_dataset.push_to_hub(repo, private=False, token=TOKEN)
|