Update teacher_function.py
Browse files- teacher_function.py +3 -2
teacher_function.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
from mistralai import Mistral
|
2 |
-
from ai71 import AI71
|
3 |
from PyPDF2 import PdfReader
|
4 |
from pdf2image import convert_from_path
|
5 |
import cv2
|
@@ -11,7 +10,9 @@ AI71_API_KEY = "api71-api-652e5c6c-8edf-41d0-9c34-28522b07bef9"
|
|
11 |
|
12 |
subprocess.run(['apt-get','update'])
|
13 |
subprocess.run(['apt-get','install','-y','tesseract-ocr'])
|
14 |
-
|
|
|
|
|
15 |
def extract_text_from_pdf(pdf_file):
|
16 |
text = ""
|
17 |
reader = PdfReader(pdf_file)
|
|
|
1 |
from mistralai import Mistral
|
|
|
2 |
from PyPDF2 import PdfReader
|
3 |
from pdf2image import convert_from_path
|
4 |
import cv2
|
|
|
10 |
|
11 |
subprocess.run(['apt-get','update'])
|
12 |
subprocess.run(['apt-get','install','-y','tesseract-ocr'])
|
13 |
+
API_KEY = 'xQ2Zhfsp4cLar4lvBRDWZKljvp0Ej427'
|
14 |
+
MODEL = "mistral-large-latest"
|
15 |
+
client = Mistral(api_key=API_KEY)
|
16 |
def extract_text_from_pdf(pdf_file):
|
17 |
text = ""
|
18 |
reader = PdfReader(pdf_file)
|