Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
mvectors
Browse files
semantic_search/llm_eval.py
CHANGED
|
@@ -18,7 +18,7 @@ import streamlit as st
|
|
| 18 |
import re
|
| 19 |
from sklearn.metrics import ndcg_score,dcg_score
|
| 20 |
from sklearn import preprocessing as pre
|
| 21 |
-
import invoke_models#invoke_llm_model
|
| 22 |
|
| 23 |
# bedrock_ = boto3.client(
|
| 24 |
# 'bedrock-runtime',
|
|
@@ -70,7 +70,7 @@ def eval(question, answers):
|
|
| 70 |
search_results += f"Index: {index_}, Description: {desc}\n\n"
|
| 71 |
index_ = index_+1
|
| 72 |
prompt = prompt.format(query, search_results)
|
| 73 |
-
response =
|
| 74 |
#response = textgen_llm(prompt)
|
| 75 |
print("Response from LLM: ", response)
|
| 76 |
inter_trim =response.split("[")[1]
|
|
|
|
| 18 |
import re
|
| 19 |
from sklearn.metrics import ndcg_score,dcg_score
|
| 20 |
from sklearn import preprocessing as pre
|
| 21 |
+
import invoke_models as llm#invoke_llm_model
|
| 22 |
|
| 23 |
# bedrock_ = boto3.client(
|
| 24 |
# 'bedrock-runtime',
|
|
|
|
| 70 |
search_results += f"Index: {index_}, Description: {desc}\n\n"
|
| 71 |
index_ = index_+1
|
| 72 |
prompt = prompt.format(query, search_results)
|
| 73 |
+
response = llm.invoke_llm_model(prompt,False)
|
| 74 |
#response = textgen_llm(prompt)
|
| 75 |
print("Response from LLM: ", response)
|
| 76 |
inter_trim =response.split("[")[1]
|