Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,19 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
import
|
|
|
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
doc_url = "https://discovery.ucl.ac.uk/id/eprint/10089234/1/343019_3_art_0_py4t4l_convrt.pdf" # Replace with the actual URL of your PDF
|
| 8 |
|
|
@@ -18,4 +29,5 @@ response = client.models.generate_content(
|
|
| 18 |
mime_type='application/pdf',
|
| 19 |
),
|
| 20 |
prompt])
|
| 21 |
-
print(response.text)
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import gradio as gr
|
| 3 |
+
import google.generativeai as genai
|
| 4 |
+
from dotenv import load_dotenv
|
| 5 |
|
| 6 |
+
load_dotenv()
|
| 7 |
+
genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
|
| 8 |
+
|
| 9 |
+
model = genai.GenerativeModel(
|
| 10 |
+
model_name="gemini-2.0-flash",
|
| 11 |
+
generation_config={
|
| 12 |
+
"temperature": 0.9,
|
| 13 |
+
"top_p": 1,
|
| 14 |
+
"max_output_tokens": 2048,
|
| 15 |
+
}
|
| 16 |
+
)
|
| 17 |
|
| 18 |
doc_url = "https://discovery.ucl.ac.uk/id/eprint/10089234/1/343019_3_art_0_py4t4l_convrt.pdf" # Replace with the actual URL of your PDF
|
| 19 |
|
|
|
|
| 29 |
mime_type='application/pdf',
|
| 30 |
),
|
| 31 |
prompt])
|
| 32 |
+
print(response.text)
|
| 33 |
+
|