Neurolingua commited on
Commit
84582aa
·
verified ·
1 Parent(s): 9d64d11

Update student_functions.py

Browse files
Files changed (1) hide show
  1. student_functions.py +1 -5
student_functions.py CHANGED
@@ -66,11 +66,8 @@ Answer: [Option number]'''},
66
  print("Quiz generated")
67
  return quiz_output
68
 
69
-
70
  def perform_ocr(image_path):
71
- model_dir = os.path.join('/app', '.EasyOCR', 'model') # Use a writable directory in the container
72
- os.makedirs(model_dir, exist_ok=True)
73
- reader = easyocr.Reader(['en'], model_storage_directory=model_dir)
74
  try:
75
  result = reader.readtext(image_path)
76
  extracted_text = ''
@@ -81,7 +78,6 @@ def perform_ocr(image_path):
81
  print(f"Error during OCR: {e}")
82
  return ''
83
 
84
-
85
  def generate_ai_response(query):
86
  ai_response = ''
87
  for chunk in AI71(AI71_API_KEY).chat.completions.create(
 
66
  print("Quiz generated")
67
  return quiz_output
68
 
 
69
  def perform_ocr(image_path):
70
+ reader = easyocr.Reader(['en'])
 
 
71
  try:
72
  result = reader.readtext(image_path)
73
  extracted_text = ''
 
78
  print(f"Error during OCR: {e}")
79
  return ''
80
 
 
81
  def generate_ai_response(query):
82
  ai_response = ''
83
  for chunk in AI71(AI71_API_KEY).chat.completions.create(