Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,10 @@ import json
|
|
7 |
# Set the OpenAI API key
|
8 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
9 |
|
|
|
|
|
|
|
|
|
10 |
# Define the authentication function
|
11 |
def check_auth(username, password):
|
12 |
# Get the credentials from the environment variable
|
@@ -130,6 +134,7 @@ iface = gr.Interface(
|
|
130 |
thumbnail="https://assets.bigcartel.com/theme_images/101321509/IMG_6002.png", # Thumbnail image URL
|
131 |
favicon_path="https://assets.bigcartel.com/theme_images/101321509/IMG_6002.png", # Favicon image URL
|
132 |
allow_flagging="manual",
|
|
|
133 |
|
134 |
)
|
135 |
|
|
|
7 |
# Set the OpenAI API key
|
8 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
9 |
|
10 |
+
# Set up flagging callback function
|
11 |
+
HF_TOKEN = os.getenv("HF_TOKEN")
|
12 |
+
hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "CannaTech/Flagged")
|
13 |
+
|
14 |
# Define the authentication function
|
15 |
def check_auth(username, password):
|
16 |
# Get the credentials from the environment variable
|
|
|
134 |
thumbnail="https://assets.bigcartel.com/theme_images/101321509/IMG_6002.png", # Thumbnail image URL
|
135 |
favicon_path="https://assets.bigcartel.com/theme_images/101321509/IMG_6002.png", # Favicon image URL
|
136 |
allow_flagging="manual",
|
137 |
+
flagging_callback=hf_writer
|
138 |
|
139 |
)
|
140 |
|