Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,9 @@ from djezzy import load_data,mot_cle,pip,vector_db
|
|
7 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
8 |
"""
|
9 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
10 |
-
|
|
|
|
|
11 |
|
12 |
def respond(
|
13 |
message,
|
@@ -28,6 +30,8 @@ def respond(
|
|
28 |
messages.append({"role": "user", "content": message})
|
29 |
|
30 |
response = ""
|
|
|
|
|
31 |
|
32 |
for message in client.chat_completion(
|
33 |
messages,
|
@@ -44,12 +48,10 @@ def respond(
|
|
44 |
"""
|
45 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
46 |
"""
|
47 |
-
|
48 |
-
|
49 |
-
docs_text, docs_embeddings
|
50 |
-
|
51 |
-
prompt=pip(question,docs_text, docs_embeddings,mots_a_verifier,vector_db)
|
52 |
-
print(prompt)
|
53 |
|
54 |
demo = gr.ChatInterface(
|
55 |
respond,
|
|
|
7 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
8 |
"""
|
9 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
10 |
+
tableau_de_mots=mot_cle("mots_clés.txt")
|
11 |
+
mots_a_verifier = tableau_de_mots
|
12 |
+
docs_text, docs_embeddings = load_data()
|
13 |
|
14 |
def respond(
|
15 |
message,
|
|
|
30 |
messages.append({"role": "user", "content": message})
|
31 |
|
32 |
response = ""
|
33 |
+
prompt=pip(message,docs_text, docs_embeddings,mots_a_verifier,vector_db)
|
34 |
+
message=prompt
|
35 |
|
36 |
for message in client.chat_completion(
|
37 |
messages,
|
|
|
48 |
"""
|
49 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
50 |
"""
|
51 |
+
|
52 |
+
#question={"role": "user", "content": message}
|
53 |
+
#prompt=pip(question,docs_text, docs_embeddings,mots_a_verifier,vector_db)
|
54 |
+
#print(prompt)
|
|
|
|
|
55 |
|
56 |
demo = gr.ChatInterface(
|
57 |
respond,
|