4 ms·
Locally? It's not really possible to run the model locally, but finetuning on directories is possible. Here's the code: It's runs on three different directory
by TrapLord_Rhodo 4y ago
Locally? It's not really possible to run the model locally, but finetuning on directories is possible.
Here's the code:
It's runs on three different directorys to give me three different 'answers' using an excel sheet to pull the q's from.
def excelGPT(self, dir, excel_file, sheet):
#my GPT Key
os.environ['OPENAI_API_KEY'] = 'sk-
#Working Directory for training
# root =
root_folder1 =
documents1 = SimpleDirectoryReader(root_folder1).load_data()
index1 = GPTSimpleVectorIndex(documents1)
root_folder2 =
documents2 = SimpleDirectoryReader(root_folder2).load_data()
index2 = GPTSimpleVectorIndex(documents2)
root_folder3 =
documents3 = SimpleDirectoryReader(root_folder3).load_data()
index3 = GPTSimpleVectorIndex(documents3)
file_name = dir + excel_file
df = pd.read_excel(file_name, sheet_name=sheet)
GSA_answer_array = []
basic_answer_array = []
QA_answer_array = []
df_series = df.iloc[:,0]
for i,x in enumerate(df_series):
print("This is the index ", i)
print(x)
GSA_response = index1.query(x)
basic_response = index2.query(x)
QA_response = index3.query(x)
GSA_answer_array.append(str(GSA_response))
basic_answer_array.append(str(basic_response))
QA_answer_array.append(str(QA_response))
self.zip_to_docv2(dir, "Gippie_Response.docx", df_series, GSA_answer_array, basic_answer_array, QA_answer_array)
- syntaxing 4y agoThis is awesome! Thank you for the code!