Update app.py
Browse files
app.py
CHANGED
|
@@ -19,6 +19,17 @@ def get_pdf_content():
|
|
| 19 |
print(f"Error loading PDF: {e}")
|
| 20 |
return None
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
def chat(message, history):
|
| 23 |
try:
|
| 24 |
pdf_content = get_pdf_content()
|
|
|
|
| 19 |
print(f"Error loading PDF: {e}")
|
| 20 |
return None
|
| 21 |
|
| 22 |
+
# Configure model with system prompt and PDF content
|
| 23 |
+
model = genai.GenerativeModel(
|
| 24 |
+
model_name="gemini-2.0-flash",
|
| 25 |
+
generation_config={
|
| 26 |
+
"temperature": 0.9,
|
| 27 |
+
"top_p": 1,
|
| 28 |
+
"max_output_tokens": 2048,
|
| 29 |
+
}
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
+
# Remove the first chat function and keep only this one
|
| 33 |
def chat(message, history):
|
| 34 |
try:
|
| 35 |
pdf_content = get_pdf_content()
|