Spaces:
No application file
No application file
Create ui_settings.py
Browse files- 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)
|