Update app.py
Browse files
app.py
CHANGED
|
@@ -5,27 +5,37 @@
|
|
| 5 |
#=========
|
| 6 |
# Library Import
|
| 7 |
|
|
|
|
|
|
|
| 8 |
import random
|
| 9 |
import gradio as gr
|
| 10 |
from huggingface_hub import InferenceClient
|
| 11 |
|
|
|
|
|
|
|
| 12 |
#=========
|
| 13 |
#=========
|
| 14 |
# Backend Logic
|
| 15 |
|
|
|
|
|
|
|
| 16 |
def random_response(message, history):
|
| 17 |
return random.choice(["Yes", "No"])
|
| 18 |
|
|
|
|
| 19 |
|
| 20 |
# =========
|
| 21 |
# =========
|
| 22 |
# User Interface (UI) Definition
|
| 23 |
|
|
|
|
|
|
|
| 24 |
with gr.Blocks(theme=gr.themes.Soft(primary_hue="teal", secondary_hue="slate", neutral_hue="neutral")) as demo: # Using Soft theme with adjusted hues for a refined look
|
| 25 |
gr.HTML("""<a href="https://visitorbadge.io/status?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2Fzelk12%2FChat_interface_test">
|
| 26 |
<img src="https://api.visitorbadge.io/api/combined?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2Fzelk12%2FChat_interface_test&countColor=%23263759" />
|
| 27 |
</a>""")
|
| 28 |
-
|
|
|
|
| 29 |
with gr.Accordion(
|
| 30 |
"API",
|
| 31 |
open=False,
|
|
@@ -123,5 +133,11 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="teal", secondary_hue="slate", n
|
|
| 123 |
label="Grounding with Google Search"
|
| 124 |
)
|
| 125 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
if __name__ == "__main__":
|
| 127 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
| 5 |
#=========
|
| 6 |
# Library Import
|
| 7 |
|
| 8 |
+
print("=========\nBegin import library\n")
|
| 9 |
+
|
| 10 |
import random
|
| 11 |
import gradio as gr
|
| 12 |
from huggingface_hub import InferenceClient
|
| 13 |
|
| 14 |
+
print("\nEnd import library\n=========")
|
| 15 |
+
|
| 16 |
#=========
|
| 17 |
#=========
|
| 18 |
# Backend Logic
|
| 19 |
|
| 20 |
+
print("=========\nBegin definition Backend Logic\n")
|
| 21 |
+
|
| 22 |
def random_response(message, history):
|
| 23 |
return random.choice(["Yes", "No"])
|
| 24 |
|
| 25 |
+
print("\nEnd definition Backend Logic\n=========")
|
| 26 |
|
| 27 |
# =========
|
| 28 |
# =========
|
| 29 |
# User Interface (UI) Definition
|
| 30 |
|
| 31 |
+
print("=========\nBegin definition User Interface (UI)\n")
|
| 32 |
+
|
| 33 |
with gr.Blocks(theme=gr.themes.Soft(primary_hue="teal", secondary_hue="slate", neutral_hue="neutral")) as demo: # Using Soft theme with adjusted hues for a refined look
|
| 34 |
gr.HTML("""<a href="https://visitorbadge.io/status?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2Fzelk12%2FChat_interface_test">
|
| 35 |
<img src="https://api.visitorbadge.io/api/combined?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2Fzelk12%2FChat_interface_test&countColor=%23263759" />
|
| 36 |
</a>""")
|
| 37 |
+
print("Test")
|
| 38 |
+
|
| 39 |
with gr.Accordion(
|
| 40 |
"API",
|
| 41 |
open=False,
|
|
|
|
| 133 |
label="Grounding with Google Search"
|
| 134 |
)
|
| 135 |
|
| 136 |
+
print("\nEnd definition User Interface (UI)\n=========")
|
| 137 |
+
|
| 138 |
+
print("=========\nBegin launch demo\n")
|
| 139 |
+
|
| 140 |
if __name__ == "__main__":
|
| 141 |
+
demo.launch()
|
| 142 |
+
|
| 143 |
+
print("\nEnd launch demo\n=========")
|