Spaces:
Runtime error
Runtime error
update
Browse files
app.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import random
|
| 3 |
-
import numpy as np
|
| 4 |
from huggingface_hub import InferenceClient
|
| 5 |
from sentence_transformers import SentenceTransformer
|
| 6 |
|
|
@@ -25,7 +24,7 @@ with open("knowledge.txt", "r", encoding="utf-8") as f:
|
|
| 25 |
|
| 26 |
|
| 27 |
def tac_chatbot(message, history):
|
| 28 |
-
messages = [{"role": "system", "content":"
|
| 29 |
|
| 30 |
if history:
|
| 31 |
messages.extend(history)
|
|
@@ -40,19 +39,19 @@ def tac_chatbot(message, history):
|
|
| 40 |
tac = gr.ChatInterface(
|
| 41 |
tac_chatbot,
|
| 42 |
title="Tamil Association of Colorado",
|
| 43 |
-
description="
|
| 44 |
textbox=gr.Textbox(placeholder="Ask Me Anything..."),
|
| 45 |
examples=[
|
| 46 |
-
"
|
| 47 |
-
"
|
| 48 |
-
"What
|
| 49 |
]
|
| 50 |
)
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
with gr.Blocks(theme=custom_theme) as demo:
|
| 55 |
-
gr.Image(value="
|
| 56 |
gr.Markdown("""
|
| 57 |
<div style="text-align:center">
|
| 58 |
<h1 class="glow">Hi, I'm TAC Bot! </h1>
|
|
@@ -78,4 +77,4 @@ I'm going to help you with any questions you have for us:
|
|
| 78 |
|
| 79 |
gr.TabbedInterface([tac], [ "TAC Information" ])
|
| 80 |
|
| 81 |
-
demo.launch(debug=
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import random
|
|
|
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
from sentence_transformers import SentenceTransformer
|
| 5 |
|
|
|
|
| 24 |
|
| 25 |
|
| 26 |
def tac_chatbot(message, history):
|
| 27 |
+
messages = [{"role": "system", "content":"You are a friendly chatbot, who can help Tamil people with their queries about Tamil Association. You can speak tamil if they ask for it in Tamil, and you must address them as nanbi, or nanba(meaning friend). If it's not in the database then you must give them this contact: (https://tamilcolorado.org/). "}]
|
| 28 |
|
| 29 |
if history:
|
| 30 |
messages.extend(history)
|
|
|
|
| 39 |
tac = gr.ChatInterface(
|
| 40 |
tac_chatbot,
|
| 41 |
title="Tamil Association of Colorado",
|
| 42 |
+
description="Hello Nanba,",
|
| 43 |
textbox=gr.Textbox(placeholder="Ask Me Anything..."),
|
| 44 |
examples=[
|
| 45 |
+
"How to get membership?",
|
| 46 |
+
"Who is the current president?",
|
| 47 |
+
"What is the history of TAC?"
|
| 48 |
]
|
| 49 |
)
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
with gr.Blocks(theme=custom_theme) as demo:
|
| 54 |
+
gr.Image(value="logo.png", show_label=False, elem_id="top-image")
|
| 55 |
gr.Markdown("""
|
| 56 |
<div style="text-align:center">
|
| 57 |
<h1 class="glow">Hi, I'm TAC Bot! </h1>
|
|
|
|
| 77 |
|
| 78 |
gr.TabbedInterface([tac], [ "TAC Information" ])
|
| 79 |
|
| 80 |
+
demo.launch(debug=True)
|