Shivanshutripathi commited on
Commit
f3c4899
·
verified ·
1 Parent(s): 29129a5

Update gradio1final.py

Browse files
Files changed (1) hide show
  1. gradio1final.py +15 -3
gradio1final.py CHANGED
@@ -550,9 +550,21 @@ def fetch_data_from_db(query):
550
 
551
  def process_gradio(query, model_type):
552
  try:
553
- # Load the CSV file
554
- csv_loader = CSVLoader(file_path='des.csv')
555
- documents = csv_loader.load()
 
 
 
 
 
 
 
 
 
 
 
 
556
 
557
  # Define the vector DB paths
558
  vector_db_path_gemini = "faiss_index_gemini"
 
550
 
551
  def process_gradio(query, model_type):
552
  try:
553
+ # URL of the CSV file hosted on Hugging Face
554
+ csv_url = 'https://huggingface.co/spaces/Shivanshutripathi/AutoBI/blob/main/des.csv'
555
+
556
+ # Fetch the CSV file content
557
+ response = requests.get(csv_url)
558
+ response.raise_for_status() # Check if the request was successful
559
+
560
+ # Load the CSV file content into a pandas DataFrame
561
+ csv_data = StringIO(response.text)
562
+ documents = pd.read_csv(csv_data)
563
+
564
+ # try:
565
+ # # Load the CSV file
566
+ # csv_loader = CSVLoader(file_path='des.csv')
567
+ # documents = csv_loader.load()
568
 
569
  # Define the vector DB paths
570
  vector_db_path_gemini = "faiss_index_gemini"