bstraehle commited on
Commit
ee1b26f
1 Parent(s): 8478da0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -43,7 +43,7 @@ def invoke(openai_api_key, prompt, rag_option):
43
  elif (rag_option == RAG_LLAMAINDEX):
44
  rag = LlamaIndexRAG()
45
  rag.ingestion(config)
46
-
47
  completion = ""
48
  result = ""
49
  callback = ""
@@ -53,14 +53,17 @@ def invoke(openai_api_key, prompt, rag_option):
53
  start_time_ms = round(time.time() * 1000)
54
 
55
  if (rag_option == RAG_LANGCHAIN):
 
56
  rag = LangChainRAG()
57
  completion, chain, callback = rag.rag_chain(config, prompt)
58
 
59
  result = completion["result"]
60
  elif (rag_option == RAG_LLAMAINDEX):
 
61
  rag = LlamaIndexRAG()
62
  result = rag.retrieval(config, prompt)
63
  else:
 
64
  rag = LangChainRAG()
65
  completion, chain, callback = rag.llm_chain(config, prompt)
66
 
@@ -76,7 +79,8 @@ def invoke(openai_api_key, prompt, rag_option):
76
 
77
  trace_wandb(
78
  config,
79
- rag_option,
 
80
  prompt,
81
  completion,
82
  result,
 
43
  elif (rag_option == RAG_LLAMAINDEX):
44
  rag = LlamaIndexRAG()
45
  rag.ingestion(config)
46
+
47
  completion = ""
48
  result = ""
49
  callback = ""
 
53
  start_time_ms = round(time.time() * 1000)
54
 
55
  if (rag_option == RAG_LANGCHAIN):
56
+ prompt_template = ""
57
  rag = LangChainRAG()
58
  completion, chain, callback = rag.rag_chain(config, prompt)
59
 
60
  result = completion["result"]
61
  elif (rag_option == RAG_LLAMAINDEX):
62
+ prompt_template = ""
63
  rag = LlamaIndexRAG()
64
  result = rag.retrieval(config, prompt)
65
  else:
66
+ prompt_template = ""
67
  rag = LangChainRAG()
68
  completion, chain, callback = rag.llm_chain(config, prompt)
69
 
 
79
 
80
  trace_wandb(
81
  config,
82
+ rag_option,
83
+ prompt_template,
84
  prompt,
85
  completion,
86
  result,