rknl commited on
Commit
b8374b8
·
verified ·
1 Parent(s): 8f552e2
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -1,14 +1,10 @@
1
- import os,re
2
  import gradio as gr
3
  import nest_asyncio
4
  from llama_index.core import StorageContext, load_index_from_storage
5
 
6
  from telcom_core import query_rag_qa, query_graph_rag_qa, plot_full_kg, evaluate_llm
7
 
8
- import networkx as nx
9
- from pyvis.network import Network
10
- from IPython.display import HTML, Markdown, display
11
-
12
 
13
  # Define constants for index paths
14
  os.environ["OPENAI_API_KEY"] = os.getenv('oai')
@@ -37,8 +33,8 @@ def query_tqa(query, search_level):
37
  Returns:
38
  tuple: Responses and references from both Graph-RAG and RAG models.
39
  """
40
- grag_response, grag_reference, grag_reference_text = query_graph_rag_qa(query, search_level)
41
- rag_response, rag_reference, rag_reference_text = query_rag_qa(query, search_level)
42
  return grag_response, grag_reference, grag_reference_text, rag_response, rag_reference, rag_reference_text
43
 
44
 
 
1
+ import os
2
  import gradio as gr
3
  import nest_asyncio
4
  from llama_index.core import StorageContext, load_index_from_storage
5
 
6
  from telcom_core import query_rag_qa, query_graph_rag_qa, plot_full_kg, evaluate_llm
7
 
 
 
 
 
8
 
9
  # Define constants for index paths
10
  os.environ["OPENAI_API_KEY"] = os.getenv('oai')
 
33
  Returns:
34
  tuple: Responses and references from both Graph-RAG and RAG models.
35
  """
36
+ grag_response, grag_reference, grag_reference_text = query_graph_rag_qa(graph_rag_index, query, search_level)
37
+ rag_response, rag_reference, rag_reference_text = query_rag_qa(rag_index, query, search_level)
38
  return grag_response, grag_reference, grag_reference_text, rag_response, rag_reference, rag_reference_text
39
 
40