Sajjo commited on
Commit
2836de6
·
verified ·
1 Parent(s): 5d90b57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py CHANGED
@@ -111,4 +111,21 @@ iface = gr.Interface(
111
  flagging_options=["correct", "wrong"]
112
  )
113
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  iface.launch()
 
111
  flagging_options=["correct", "wrong"]
112
  )
113
 
114
+ iface.launch()
115
+
116
+ import os
117
+
118
+ HF_TOKEN = os.getenv('HF_TOKEN')
119
+ hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "crowdsourced-calculator-demo")
120
+
121
+ iface = gr.Interface(
122
+ calculator,
123
+ ["number", gr.Radio(["add", "subtract", "multiply", "divide"]), "number"],
124
+ "number",
125
+ description="Check out the crowd-sourced dataset at: [https://huggingface.co/datasets/aliabd/crowdsourced-calculator-demo](https://huggingface.co/datasets/aliabd/crowdsourced-calculator-demo)",
126
+ allow_flagging="manual",
127
+ flagging_options=["wrong sign", "off by one", "other"],
128
+ flagging_callback=hf_writer
129
+ )
130
+
131
  iface.launch()