Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -11,14 +11,14 @@ from sentence_transformers import CrossEncoder
|
|
11 |
os.environ['GROQ_API_KEY'] = "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"
|
12 |
|
13 |
PROMPT = """/
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
|
23 |
"""
|
24 |
|
@@ -104,7 +104,7 @@ class QAChatbot:
|
|
104 |
return response
|
105 |
|
106 |
def chatbot_interface(query, history):
|
107 |
-
file_paths = ["
|
108 |
documents = load_documents(file_paths)
|
109 |
|
110 |
indexer = DocumentIndexer(documents, tokenizer, model)
|
|
|
11 |
os.environ['GROQ_API_KEY'] = "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"
|
12 |
|
13 |
PROMPT = """/
|
14 |
+
You are a virtual representative of a retail company and a consultant for customers.
|
15 |
+
To generate answers, use only information from the context!
|
16 |
+
Do not ask additional questions, but simply offer the product available in the context!
|
17 |
+
Your goal is to answer customers' questions, thus helping them.
|
18 |
+
You should advise the customer in choosing products using the context.
|
19 |
+
If you could not find a specific answer:
|
20 |
+
- Answer "I do not know. For more information, please contact: +380954673526" and nothing more.
|
21 |
+
You always maintain a polite, professional tone. The format of the answer should be simple, understandable and clear. Avoid long explanations if they are not necessary.
|
22 |
|
23 |
"""
|
24 |
|
|
|
104 |
return response
|
105 |
|
106 |
def chatbot_interface(query, history):
|
107 |
+
file_paths = ["Company_eng.txt", "base_eng.txt"]
|
108 |
documents = load_documents(file_paths)
|
109 |
|
110 |
indexer = DocumentIndexer(documents, tokenizer, model)
|