CannaTech commited on
Commit
067918b
·
1 Parent(s): e54d477

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -4,6 +4,11 @@ import openai
4
  import gradio as gr
5
  import json
6
 
 
 
 
 
 
7
  # Set the OpenAI API key
8
  openai.api_key = os.getenv("OPENAI_API_KEY")
9
 
@@ -129,6 +134,10 @@ iface = gr.Interface(
129
  on growing your business!""", # Article text
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
  )
133
 
134
  # Launch the interface with authentication
 
4
  import gradio as gr
5
  import json
6
 
7
+ # Set the flagging function
8
+
9
+ HF_TOKEN = os.getenv('HF_TOKEN')
10
+ hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "flagged")
11
+
12
  # Set the OpenAI API key
13
  openai.api_key = os.getenv("OPENAI_API_KEY")
14
 
 
134
  on growing your business!""", # Article text
135
  thumbnail="https://assets.bigcartel.com/theme_images/101321509/IMG_6002.png", # Thumbnail image URL
136
  favicon_path="https://assets.bigcartel.com/theme_images/101321509/IMG_6002.png", # Favicon image URL
137
+ allow_flagging="manual",
138
+ flagging_options=["Inaccurate Information", "Not Applicable", "Not Helpful"],
139
+ flagging_callback=hf_writer
140
+
141
  )
142
 
143
  # Launch the interface with authentication