Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,6 @@ from sentence_transformers import SentenceTransformer
|
|
| 9 |
load_dotenv()
|
| 10 |
|
| 11 |
# Configure the Llama index settings
|
| 12 |
-
|
| 13 |
Settings.llm = HuggingFaceInferenceAPI(
|
| 14 |
model_name="meta-llama/Meta-Llama-3-8B-Instruct",
|
| 15 |
tokenizer_name="meta-llama/Meta-Llama-3-8B-Instruct",
|
|
@@ -45,20 +44,12 @@ def handle_query(query):
|
|
| 45 |
(
|
| 46 |
"user",
|
| 47 |
"""
|
| 48 |
-
You are
|
| 49 |
-
Your primary objective is to provide accurate, concise, and helpful responses to any user queries related to Taj Hotels' information.
|
| 50 |
-
|
| 51 |
-
**Guidelines for Responses**:
|
| 52 |
-
- Responses must not exceed **15 words**.
|
| 53 |
-
- Provide accurate and relevant information from the context or data provided.
|
| 54 |
-
- Respond in the **same language** as the user's query (e.g., English, Hindi, etc.).
|
| 55 |
-
- Avoid adding speculative, irrelevant, or unverifiable information.
|
| 56 |
-
- If unsure, respond with: **"Sorry, I don't have the information you're looking for."**
|
| 57 |
|
| 58 |
-
|
| 59 |
{context_str}
|
| 60 |
|
| 61 |
-
|
| 62 |
{query_str}
|
| 63 |
"""
|
| 64 |
)
|
|
@@ -112,7 +103,7 @@ data_ingestion_from_directory()
|
|
| 112 |
# Define the input and output components for the Gradio interface
|
| 113 |
input_component = gr.Textbox(
|
| 114 |
show_label=False,
|
| 115 |
-
placeholder="Ask me anything about
|
| 116 |
)
|
| 117 |
|
| 118 |
output_component = gr.Textbox()
|
|
@@ -127,8 +118,8 @@ interface = gr.Interface(
|
|
| 127 |
fn=chatbot_handler,
|
| 128 |
inputs=input_component,
|
| 129 |
outputs=output_component,
|
| 130 |
-
title="
|
| 131 |
-
description="I am here to assist you with any questions
|
| 132 |
)
|
| 133 |
|
| 134 |
# Launch the Gradio interface
|
|
|
|
| 9 |
load_dotenv()
|
| 10 |
|
| 11 |
# Configure the Llama index settings
|
|
|
|
| 12 |
Settings.llm = HuggingFaceInferenceAPI(
|
| 13 |
model_name="meta-llama/Meta-Llama-3-8B-Instruct",
|
| 14 |
tokenizer_name="meta-llama/Meta-Llama-3-8B-Instruct",
|
|
|
|
| 44 |
(
|
| 45 |
"user",
|
| 46 |
"""
|
| 47 |
+
You are the JackNJill Solutions chatbot. Your goal is to provide accurate, professional, and helpful answers to user queries based on the company's data. Always ensure your responses are clear and concise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
+
Context:
|
| 50 |
{context_str}
|
| 51 |
|
| 52 |
+
Question:
|
| 53 |
{query_str}
|
| 54 |
"""
|
| 55 |
)
|
|
|
|
| 103 |
# Define the input and output components for the Gradio interface
|
| 104 |
input_component = gr.Textbox(
|
| 105 |
show_label=False,
|
| 106 |
+
placeholder="Ask me anything about JackNJill Solutions..."
|
| 107 |
)
|
| 108 |
|
| 109 |
output_component = gr.Textbox()
|
|
|
|
| 118 |
fn=chatbot_handler,
|
| 119 |
inputs=input_component,
|
| 120 |
outputs=output_component,
|
| 121 |
+
title="Welcome to JackNJill Solutions",
|
| 122 |
+
description="I am here to assist you with any questions you have about JackNJill Solutions. How can I help you today?"
|
| 123 |
)
|
| 124 |
|
| 125 |
# Launch the Gradio interface
|