Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,8 +7,6 @@ from huggingface_hub.inference._generated.types.chat_completion import ChatCompl
|
|
7 |
MODEL = "nomiChroma3.1"
|
8 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
9 |
|
10 |
-
from huggingface_hub.inference._generated.types.chat_completion import ChatCompletionStreamOutput
|
11 |
-
|
12 |
def respond(
|
13 |
message,
|
14 |
history: list[tuple[str, str]],
|
@@ -71,7 +69,20 @@ def respond(
|
|
71 |
else:
|
72 |
yield f"An error occurred: {e}"
|
73 |
|
74 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
demo = gr.ChatInterface(
|
76 |
respond,
|
77 |
additional_inputs=[
|
@@ -91,15 +102,21 @@ demo = gr.ChatInterface(
|
|
91 |
],
|
92 |
title="Maritime Legal Compliance",
|
93 |
description="This chatbot uses Fine-tuned LLAMA-3.1 model personalised specifically to provide assistance with Indian maritime legal queries.",
|
94 |
-
theme=
|
|
|
|
|
|
|
|
|
95 |
examples=[
|
96 |
["What are the key regulations governing ports in India?"],
|
97 |
["Explain the concept of cabotage in Indian maritime law."],
|
98 |
["What are the legal requirements for registering a vessel in India?"],
|
99 |
],
|
|
|
100 |
cache_examples=False,
|
101 |
)
|
102 |
|
103 |
# Launch the Gradio app
|
104 |
if __name__ == "__main__":
|
105 |
demo.launch()
|
|
|
|
7 |
MODEL = "nomiChroma3.1"
|
8 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
9 |
|
|
|
|
|
10 |
def respond(
|
11 |
message,
|
12 |
history: list[tuple[str, str]],
|
|
|
69 |
else:
|
70 |
yield f"An error occurred: {e}"
|
71 |
|
72 |
+
# Custom CSS for light blue background
|
73 |
+
custom_css = """
|
74 |
+
.gradio-container {
|
75 |
+
background-color: #e6f3ff !important;
|
76 |
+
}
|
77 |
+
.chat-window {
|
78 |
+
background-color: #f0f8ff !important;
|
79 |
+
}
|
80 |
+
.message-wrap {
|
81 |
+
background-color: #ffffff !important;
|
82 |
+
}
|
83 |
+
"""
|
84 |
+
|
85 |
+
# Gradio interface setup with custom theme
|
86 |
demo = gr.ChatInterface(
|
87 |
respond,
|
88 |
additional_inputs=[
|
|
|
102 |
],
|
103 |
title="Maritime Legal Compliance",
|
104 |
description="This chatbot uses Fine-tuned LLAMA-3.1 model personalised specifically to provide assistance with Indian maritime legal queries.",
|
105 |
+
theme=gr.themes.Soft(
|
106 |
+
primary_hue="blue",
|
107 |
+
secondary_hue="blue",
|
108 |
+
neutral_hue="blue",
|
109 |
+
).set_background(color="#e6f3ff"),
|
110 |
examples=[
|
111 |
["What are the key regulations governing ports in India?"],
|
112 |
["Explain the concept of cabotage in Indian maritime law."],
|
113 |
["What are the legal requirements for registering a vessel in India?"],
|
114 |
],
|
115 |
+
css=custom_css,
|
116 |
cache_examples=False,
|
117 |
)
|
118 |
|
119 |
# Launch the Gradio app
|
120 |
if __name__ == "__main__":
|
121 |
demo.launch()
|
122 |
+
|