Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -115,7 +115,7 @@ def rag_chain(llm, prompt, db):
|
|
115 |
completion = rag_chain({"query": prompt})
|
116 |
return completion
|
117 |
|
118 |
-
def wandb_trace(rag_option, prompt, prompt_template, result, completion, chain_name, status_msg, start_time_ms, end_time_ms
|
119 |
wandb.init(project = "openai-llm-rag")
|
120 |
trace = Trace(
|
121 |
name = chain_name,
|
@@ -133,7 +133,7 @@ def wandb_trace(rag_option, prompt, prompt_template, result, completion, chain_n
|
|
133 |
end_time_ms = end_time_ms,
|
134 |
inputs = {"rag_option": rag_option, "prompt": str(prompt), "prompt_template": str(prompt_template)},
|
135 |
outputs = {"result": str(result), "completion": str(completion)},
|
136 |
-
model_dict = {"llm": str(llm)}
|
137 |
)
|
138 |
trace.log("test")
|
139 |
wandb.finish()
|
@@ -180,7 +180,7 @@ def invoke(openai_api_key, rag_option, prompt):
|
|
180 |
raise gr.Error(e)
|
181 |
finally:
|
182 |
end_time_ms = round(time.time() * 1000)
|
183 |
-
wandb_trace(rag_option, prompt, prompt_template, result, completion, chain_name, status_msg, start_time_ms, end_time_ms
|
184 |
return result
|
185 |
|
186 |
description = """<strong>Overview:</strong> Context-aware multimodal reasoning application using a <strong>large language model (LLM)</strong> with
|
|
|
115 |
completion = rag_chain({"query": prompt})
|
116 |
return completion
|
117 |
|
118 |
+
def wandb_trace(rag_option, prompt, prompt_template, result, completion, chain_name, status_msg, start_time_ms, end_time_ms):
|
119 |
wandb.init(project = "openai-llm-rag")
|
120 |
trace = Trace(
|
121 |
name = chain_name,
|
|
|
133 |
end_time_ms = end_time_ms,
|
134 |
inputs = {"rag_option": rag_option, "prompt": str(prompt), "prompt_template": str(prompt_template)},
|
135 |
outputs = {"result": str(result), "completion": str(completion)},
|
136 |
+
#model_dict = {"llm": str(llm)}
|
137 |
)
|
138 |
trace.log("test")
|
139 |
wandb.finish()
|
|
|
180 |
raise gr.Error(e)
|
181 |
finally:
|
182 |
end_time_ms = round(time.time() * 1000)
|
183 |
+
wandb_trace(rag_option, prompt, prompt_template, result, completion, chain_name, status_msg, start_time_ms, end_time_ms)
|
184 |
return result
|
185 |
|
186 |
description = """<strong>Overview:</strong> Context-aware multimodal reasoning application using a <strong>large language model (LLM)</strong> with
|