Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,13 +5,7 @@ import google.generativeai as genai
|
|
5 |
import fitz # PyMuPDF to read PDF
|
6 |
|
7 |
# Load Gemini API key from Hugging Face secret
|
8 |
-
genai.configure(api_key=os.getenv("
|
9 |
-
model = genai.GenerativeModel("gemini-2.0-flash")
|
10 |
-
|
11 |
-
# PDF reading utility
|
12 |
-
def extract_text_from_pdf(pdf_file):
|
13 |
-
text = ""
|
14 |
-
doc = fitz.open(pdf_file.name)
|
15 |
for page in doc:
|
16 |
text += page.get_text()
|
17 |
return text.strip()
|
|
|
5 |
import fitz # PyMuPDF to read PDF
|
6 |
|
7 |
# Load Gemini API key from Hugging Face secret
|
8 |
+
genai.configure(api_key=os.getenv("API_Key
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
for page in doc:
|
10 |
text += page.get_text()
|
11 |
return text.strip()
|