Koshti10 commited on
Commit
829fd6d
·
verified ·
1 Parent(s): af5897d

debug tmpfile error

Browse files
Files changed (2) hide show
  1. app_drive.py +2 -2
  2. driveapi/drive.py +1 -3
app_drive.py CHANGED
@@ -12,9 +12,9 @@ from driveapi.drive_database import create_chroma_db
12
 
13
  # global time_diff, model_name, search_type
14
  time_diff = 0
15
- model_name="gpt-3.5-turbo-1106" # FOR TESTING
16
  # model_name = "gpt-4-1106-preview"https://huggingface.co/spaces/Koshti10/Chat_literature/edit/main/app_drive.py
17
- # model_name = "gpt-4-0125-preview"
18
  search_type = "stuff"
19
  input_question = ""
20
  model_response = ""
 
12
 
13
  # global time_diff, model_name, search_type
14
  time_diff = 0
15
+ # model_name="gpt-3.5-turbo-1106" # FOR TESTING
16
  # model_name = "gpt-4-1106-preview"https://huggingface.co/spaces/Koshti10/Chat_literature/edit/main/app_drive.py
17
+ model_name = "gpt-4-0125-preview"
18
  search_type = "stuff"
19
  input_question = ""
20
  model_response = ""
driveapi/drive.py CHANGED
@@ -50,9 +50,7 @@ def download_file(file_id):
50
 
51
  # Function to process a PDF file
52
  def process_pdf(file_stream):
53
- print(f"File stream is of type: {type(file_stream)}")
54
- print(f"File stream is: {file_stream}")
55
- file_path = file_stream['name']
56
  pdf_reader = PyPDF2.PdfReader(file_path)
57
  text = ""
58
  for page_num in range(len(pdf_reader.pages)):
 
50
 
51
  # Function to process a PDF file
52
  def process_pdf(file_stream):
53
+ file_path = file_stream['name'] # Use 'path' for local testing and 'name' for Gradio
 
 
54
  pdf_reader = PyPDF2.PdfReader(file_path)
55
  text = ""
56
  for page_num in range(len(pdf_reader.pages)):