JeCabrera commited on
Commit
2d98164
·
verified ·
1 Parent(s): 9a3b936

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -5
app.py CHANGED
@@ -1,8 +1,19 @@
1
- from google import genai
2
- from google.genai import types
3
- import httpx
 
4
 
5
- client = genai.Client()
 
 
 
 
 
 
 
 
 
 
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
+