jonathanjordan21 commited on
Commit
03e99bc
·
verified ·
1 Parent(s): ac3b7ca

Update custom_llm.py

Browse files
Files changed (1) hide show
  1. 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(e))
195
- text = err_chain.invoke({"code":text, "err":str(e)})
196
- e_ = 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_)