Spaces:
Runtime error
Runtime error
Commit
•
678c142
1
Parent(s):
ec415b0
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
@@ -285,17 +285,32 @@ def load_llama_index(self,vindex='vector_index',vpath='./index_storage'):
|
|
285 |
monty.load_llama_index()
|
286 |
|
287 |
@add_method(HFace_Pluto)
|
288 |
-
def ask_me(self, p):
|
|
|
289 |
if (self._llama_query_engine is None):
|
290 |
self._llama_query_engine = self._llama_index_doc.as_query_engine()
|
291 |
-
|
292 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
|
294 |
in_box = [gradio.Textbox(lines=1, label="Your Humana request", placeholder="Your Humana request...see example if you need help.")
|
295 |
-
|
|
|
296 |
]
|
297 |
-
out_box = [gradio.Textbox(label="Humana response:")
|
298 |
-
|
|
|
299 |
]
|
300 |
#
|
301 |
|
|
|
285 |
monty.load_llama_index()
|
286 |
|
287 |
@add_method(HFace_Pluto)
|
288 |
+
def ask_me(self, p, q, r , ll_index_name=None, ll_sign_in_member=None):
|
289 |
+
# todo: make this into a dict so not to use if/else
|
290 |
if (self._llama_query_engine is None):
|
291 |
self._llama_query_engine = self._llama_index_doc.as_query_engine()
|
292 |
+
|
293 |
+
if (ll_index_name is None):
|
294 |
+
ll_engine = self._llama_query_engine
|
295 |
+
|
296 |
+
ll_sign_in_member = q
|
297 |
+
|
298 |
+
#
|
299 |
+
if (ll_sign_in_member is None):
|
300 |
+
px = p
|
301 |
+
else:
|
302 |
+
px = f'My name is {ll_sign_in_member}, and I want answer to the following: {p} , if you haven\'t found {ll_sign_in_member} , Just say i don\'t have much information on this.'
|
303 |
+
#
|
304 |
+
resp = ll_engine.query(px)
|
305 |
+
return resp , q , r
|
306 |
|
307 |
in_box = [gradio.Textbox(lines=1, label="Your Humana request", placeholder="Your Humana request...see example if you need help.")
|
308 |
+
,gradio.Radio(["Duc", "Girish", "Mayo"], label="Login Member", value='Duc', info="Who had login?")
|
309 |
+
,gradio.Radio(["Humana", "Kohli Fighters", "Ally Bank"], label="Login Member", value='Humana', info="Fine-Tune LLM for:")
|
310 |
]
|
311 |
+
out_box = [gradio.Textbox(label="Humana response:"),
|
312 |
+
gradio.Radio(["Duc", "Girish", "Mayo"], label="Login Member", value='Duc', info="Who had login?"),
|
313 |
+
gradio.Radio(["Humana", "Kohli Fighters", "Ally Bank"], label="Login Member", value='Humana', info="Fine-Tune LLM for:")
|
314 |
]
|
315 |
#
|
316 |
|