Update custom_llm.py
Browse files- custom_llm.py +4 -4
custom_llm.py
CHANGED
@@ -22,7 +22,7 @@ from langchain_community.embeddings import HuggingFaceInferenceAPIEmbeddings
|
|
22 |
|
23 |
from langchain.vectorstores import FAISS
|
24 |
|
25 |
-
import pickle, asyncio
|
26 |
|
27 |
# os.environ['FAISS_NO_AVX2'] = '1'
|
28 |
import pandas as pd
|
@@ -191,9 +191,9 @@ def out_format(text, llm, df):
|
|
191 |
|
192 |
return text
|
193 |
except Exception as e:
|
194 |
-
print(f"ERORRR! ATTEMPT : {i}\n",str(
|
195 |
-
text = err_chain.invoke({"code":text, "err":str(
|
196 |
-
e_ =
|
197 |
# exec(text)
|
198 |
|
199 |
return "Bad Python Code, Error Message : " + str(e_)
|
|
|
22 |
|
23 |
from langchain.vectorstores import FAISS
|
24 |
|
25 |
+
import pickle, asyncio, traceback
|
26 |
|
27 |
# os.environ['FAISS_NO_AVX2'] = '1'
|
28 |
import pandas as pd
|
|
|
191 |
|
192 |
return text
|
193 |
except Exception as e:
|
194 |
+
print(f"ERORRR! ATTEMPT : {i}\n",str(traceback.format_exc(limit=2)))
|
195 |
+
text = err_chain.invoke({"code":text, "err":str(traceback.format_exc(limit=2))})
|
196 |
+
e_ = traceback.format_exc(limit=2)
|
197 |
# exec(text)
|
198 |
|
199 |
return "Bad Python Code, Error Message : " + str(e_)
|