Atchyuteswar commited on
Commit
6888b05
1 Parent(s): 1eaec15

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -0
app.py ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import google.generativeai as genai
2
+ from pathlib import path
3
+ import gradio as gr
4
+
5
+ generation_config = {
6
+ "temprature": 0,
7
+ "top_p" : 1,
8
+ "top_k" : 32,
9
+ "max_output_token" : 4096,
10
+ }
11
+
12
+ safety_settings = [
13
+ {
14
+ "category" : "HARM_CATEGORY_HARASSMENT",
15
+ "threshold" : "BLOCK_MEDIUM_AND_ABOVE"
16
+ },
17
+ {
18
+ "category" : "HARM_CATEGORY_HATE_SPEECH",
19
+ "threshold" : "BLOCK_MEDIUM_AND_ABOVE"
20
+ },
21
+ {
22
+ "category" : "HARM_CATEGORY_SEXUALLY_EXPLICIT",
23
+ "threshold" : "BLOCK_MEDIUM_AND_ABOVE"
24
+ },
25
+ {
26
+ "category" : "HARM_CATEGORY_DANGEROUS_CONTENT",
27
+ "threshold" : "BLOCK_MEDIUM_AND_ABOVE"
28
+ },
29
+ ]
30
+
31
+ genai.configure(api_key = "AIzaSyD6j1XrvNXktCFReBWo9Z5uB88fgCu6FB0")
32
+
33
+ model = genai.GenerativeModel(model_name = "gemini-pro-vision",
34
+ generation_config = generation_config,
35
+ safty_settings = safety_settings)
36
+
37
+ import_prompt = """ """