-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
28 lines (24 loc) · 1.11 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import argparse
from src.LLM_SQL_Support.agent import Agent
from src.LLM_SQL_Support.model_loader import load_model
from src.LLM_SQL_Support.LangchainTools import llm
def main(fine_tune):
if fine_tune:
pass
from src.model_finetuning.fine_tuning import fine_tune_model # Import fine-tuning logic
print("Fine-tuning the model... Please wait.")
fine_tune_model() # Assuming you have a function for fine-tuning the model
print("Fine-tuning completed!")
# Proceed with running the model
react_agent, react_agent_executor = Agent(llm)
query = "I wanna cancel my order"
print(f"Executing query: {query}")
react_agent_executor.invoke({"input": query})
if __name__ == "__main__":
# Set up argument parsing
parser = argparse.ArgumentParser(description="Run the model with or without fine-tuning.")
parser.add_argument('--fine_tune', action='store_true', help="Fine-tune the model before running it.")
# Parse the arguments
args = parser.parse_args()
# Call the main function with the parsed argument
main(args.fine_tune)