Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,10 +10,11 @@ openai.api_key = os.getenv("OPENAI_API_KEY")
|
|
10 |
|
11 |
# Set up the Hugging Face Dataset Saver
|
12 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
|
|
13 |
|
14 |
class CustomFlaggingCallback:
|
15 |
def __init__(self, hf_token, dataset_name):
|
16 |
-
self.hf_writer = gr.HuggingFaceDatasetSaver(
|
17 |
|
18 |
def __call__(self, input_data, output_data):
|
19 |
# Custom logic to handle flagged data
|
@@ -22,7 +23,7 @@ class CustomFlaggingCallback:
|
|
22 |
self.hf_writer.flush()
|
23 |
|
24 |
# Create an instance of the custom flagging callback
|
25 |
-
custom_callback = CustomFlaggingCallback(HF_TOKEN,
|
26 |
|
27 |
|
28 |
# Define the authentication function
|
|
|
10 |
|
11 |
# Set up the Hugging Face Dataset Saver
|
12 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
13 |
+
DATASET_NAME = "CannaTech/Flagged"
|
14 |
|
15 |
class CustomFlaggingCallback:
|
16 |
def __init__(self, hf_token, dataset_name):
|
17 |
+
self.hf_writer = gr.HuggingFaceDatasetSaver(hf_token, dataset_name)
|
18 |
|
19 |
def __call__(self, input_data, output_data):
|
20 |
# Custom logic to handle flagged data
|
|
|
23 |
self.hf_writer.flush()
|
24 |
|
25 |
# Create an instance of the custom flagging callback
|
26 |
+
custom_callback = CustomFlaggingCallback(HF_TOKEN, DATASET_NAME)
|
27 |
|
28 |
|
29 |
# Define the authentication function
|