Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -113,14 +113,8 @@ def rag_chain(llm, prompt, db):
|
|
113 |
|
114 |
def evaluate(prompt, completion, rag_option):
|
115 |
wandb.login(key = wandb_api_key)
|
116 |
-
wandb.config["model"] = config.model
|
117 |
-
wandb.config["temperature"] = config.temperature
|
118 |
-
wandb.config["rag_option"] = rag_option
|
119 |
-
wandb.config["prompt"] = prompt
|
120 |
-
wandb.config["completion"] = completion
|
121 |
wandb.init(project = "openai-llm-rag", config = config)
|
122 |
-
|
123 |
-
wandb.log({"prompt": prompt, "completion": completion})
|
124 |
wandb.logout()
|
125 |
|
126 |
def invoke(openai_api_key, rag_option, prompt):
|
@@ -131,9 +125,9 @@ def invoke(openai_api_key, rag_option, prompt):
|
|
131 |
if (prompt == ""):
|
132 |
raise gr.Error("Prompt is required.")
|
133 |
try:
|
134 |
-
llm = ChatOpenAI(model_name = config
|
135 |
openai_api_key = openai_api_key,
|
136 |
-
temperature = config
|
137 |
if (rag_option == "Chroma"):
|
138 |
#splits = document_loading_splitting()
|
139 |
#document_storage_chroma(splits)
|
|
|
113 |
|
114 |
def evaluate(prompt, completion, rag_option):
|
115 |
wandb.login(key = wandb_api_key)
|
|
|
|
|
|
|
|
|
|
|
116 |
wandb.init(project = "openai-llm-rag", config = config)
|
117 |
+
wandb.log({"prompt": prompt, "completion": completion, "rag_option": rag_option})
|
|
|
118 |
wandb.logout()
|
119 |
|
120 |
def invoke(openai_api_key, rag_option, prompt):
|
|
|
125 |
if (prompt == ""):
|
126 |
raise gr.Error("Prompt is required.")
|
127 |
try:
|
128 |
+
llm = ChatOpenAI(model_name = config["model"],
|
129 |
openai_api_key = openai_api_key,
|
130 |
+
temperature = config["temperature"])
|
131 |
if (rag_option == "Chroma"):
|
132 |
#splits = document_loading_splitting()
|
133 |
#document_storage_chroma(splits)
|