Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,9 @@ from sentence_transformers import SentenceTransformer, util
|
|
| 3 |
import openai
|
| 4 |
import os
|
| 5 |
|
|
|
|
|
|
|
|
|
|
| 6 |
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
| 7 |
|
| 8 |
# Initialize paths and model identifiers for easy configuration and maintenance
|
|
@@ -156,8 +159,9 @@ with gr.Blocks(theme='gradio/soft') as demo:
|
|
| 156 |
["What is the definition of gyatt?"]
|
| 157 |
],
|
| 158 |
allow_flagging="manual",
|
| 159 |
-
flagging_dir = "flag",
|
| 160 |
-
flagging_options=["Ambiguous", "Wrong", "Other"]
|
|
|
|
| 161 |
|
| 162 |
)
|
| 163 |
|
|
|
|
| 3 |
import openai
|
| 4 |
import os
|
| 5 |
|
| 6 |
+
HF_TOKEN = os.getenv('HF_TOKEN')
|
| 7 |
+
hf_writer =gr.HuggingFaceDatasetSaver(HF_TOKEN, "RotBot_Flags")
|
| 8 |
+
|
| 9 |
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
| 10 |
|
| 11 |
# Initialize paths and model identifiers for easy configuration and maintenance
|
|
|
|
| 159 |
["What is the definition of gyatt?"]
|
| 160 |
],
|
| 161 |
allow_flagging="manual",
|
| 162 |
+
# flagging_dir = "flag",
|
| 163 |
+
flagging_options=["Ambiguous", "Wrong", "Other"],
|
| 164 |
+
flagging_callback=hf_writer
|
| 165 |
|
| 166 |
)
|
| 167 |
|