rishabhsetiya commited on
Commit
77e953f
·
verified ·
1 Parent(s): 8607821

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -117,7 +117,20 @@ def load_model(model_id):
117
  {"question": "What was MakeMyTrip's total revenue for the year ended March 31, 2025?",
118
  "answer": "MakeMyTrip's total revenue for the year ended March 31, 2025 was USD 978,336 thousand."},
119
  ]
 
 
 
 
 
 
 
 
 
 
 
120
  df = pd.DataFrame(data)
 
 
121
  training_data = []
122
  system_prompt = "You are a helpful assistant that provides financial data from MakeMyTrip reports."
123
  for index, row in df.iterrows():
 
117
  {"question": "What was MakeMyTrip's total revenue for the year ended March 31, 2025?",
118
  "answer": "MakeMyTrip's total revenue for the year ended March 31, 2025 was USD 978,336 thousand."},
119
  ]
120
+
121
+ # Get the path of the current script
122
+ current_dir = os.path.dirname(os.path.abspath(__file__))
123
+
124
+ # JSON file name (assume it's called 'data.json')
125
+ json_file_path = os.path.join(current_dir, 'data.json')
126
+
127
+ # Read JSON file
128
+ with open(json_file_path, 'r', encoding='utf-8') as f:
129
+ data = json.load(f)
130
+
131
  df = pd.DataFrame(data)
132
+
133
+ print(f"Loaded dataset containing {len(df)} questions")
134
  training_data = []
135
  system_prompt = "You are a helpful assistant that provides financial data from MakeMyTrip reports."
136
  for index, row in df.iterrows():