sid-0313 commited on
Commit
ddf4814
·
verified ·
1 Parent(s): 48eace2

Create ui_settings.py

Browse files
Files changed (1) hide show
  1. src/utils/ui_settings.py +14 -0
src/utils/ui_settings.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ class UISettings:
4
+ @staticmethod
5
+ def toggle_sidebar(state):
6
+ state = not state
7
+ return gr.update(visible=state), state
8
+
9
+ @staticmethod
10
+ def feedback(data: gr.LikeData):
11
+ if data.liked:
12
+ print("You upvoted this response: " + data.value)
13
+ else:
14
+ print("You downvoted this response: " + data.value)