Adding a function to be used in gardio
Browse files
RAG.py
CHANGED
@@ -75,4 +75,14 @@ def generateResponseBasedOnContext(model_name, context_string, query):
|
|
75 |
print("context : ", context)
|
76 |
|
77 |
result = question_answerer(question=query, context=context)
|
78 |
-
return result['answer']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
print("context : ", context)
|
76 |
|
77 |
result = question_answerer(question=query, context=context)
|
78 |
+
return result['answer']
|
79 |
+
|
80 |
+
|
81 |
+
def gradio_adapted_RAG(model_name, query):
|
82 |
+
context = str(RAG_Langchain(query)['Content'])
|
83 |
+
generated_answer = generateResponseBasedOnContext(str(model_name),
|
84 |
+
context,
|
85 |
+
query)
|
86 |
+
return generated_answer
|
87 |
+
|
88 |
+
|