Spaces:
Sleeping
Sleeping
added introductory prompt
Browse files- backend.py +3 -3
backend.py
CHANGED
@@ -16,8 +16,6 @@ from llama_index.core.llms import ChatMessage, MessageRole
|
|
16 |
|
17 |
|
18 |
|
19 |
-
|
20 |
-
|
21 |
huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
|
22 |
login(huggingface_token)
|
23 |
|
@@ -102,7 +100,7 @@ def handle_query(query_str: str,
|
|
102 |
|
103 |
index = build_index("data/chiarimento.txt")
|
104 |
gr.Info("index costruito con richiesta di chiarimento")
|
105 |
-
|
106 |
|
107 |
else:
|
108 |
|
@@ -132,9 +130,11 @@ def handle_query(query_str: str,
|
|
132 |
verbose=False,
|
133 |
)
|
134 |
|
|
|
135 |
|
136 |
outputs = []
|
137 |
response = chat_engine.stream_chat(query_str, conversation)
|
|
|
138 |
#response = chat_engine.chat(query_str)
|
139 |
for token in response.response_gen:
|
140 |
#if not token.startswith("system:") and not token.startswith("user:"):
|
|
|
16 |
|
17 |
|
18 |
|
|
|
|
|
19 |
huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
|
20 |
login(huggingface_token)
|
21 |
|
|
|
100 |
|
101 |
index = build_index("data/chiarimento.txt")
|
102 |
gr.Info("index costruito con richiesta di chiarimento")
|
103 |
+
|
104 |
|
105 |
else:
|
106 |
|
|
|
130 |
verbose=False,
|
131 |
)
|
132 |
|
133 |
+
#chat_engine.reset()
|
134 |
|
135 |
outputs = []
|
136 |
response = chat_engine.stream_chat(query_str, conversation)
|
137 |
+
|
138 |
#response = chat_engine.chat(query_str)
|
139 |
for token in response.response_gen:
|
140 |
#if not token.startswith("system:") and not token.startswith("user:"):
|