Athspi commited on
Commit
faf24f5
·
verified ·
1 Parent(s): a97d8ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -44,6 +44,15 @@ def process_image():
44
  # Build the prompt
45
  prompt = f"Remove the {object_type} from the image and fill the area naturally."
46
 
 
 
 
 
 
 
 
 
 
47
  # Generate content
48
  response = model.generate_content(
49
  [
@@ -56,9 +65,7 @@ def process_image():
56
  "top_k": 40,
57
  "max_output_tokens": 8192,
58
  },
59
- safety_settings={
60
- "HARM_CATEGORY_CIVIC_INTEGRITY": "BLOCK_NONE"
61
- }
62
  )
63
 
64
  # Process response
 
44
  # Build the prompt
45
  prompt = f"Remove the {object_type} from the image and fill the area naturally."
46
 
47
+ # Disable all safety settings
48
+ safety_settings = {
49
+ "HARM_CATEGORY_HARASSMENT": "BLOCK_NONE",
50
+ "HARM_CATEGORY_HATE_SPEECH": "BLOCK_NONE",
51
+ "HARM_CATEGORY_SEXUALLY_EXPLICIT": "BLOCK_NONE",
52
+ "HARM_CATEGORY_DANGEROUS_CONTENT": "BLOCK_NONE",
53
+ "HARM_CATEGORY_CIVIC_INTEGRITY": "BLOCK_NONE"
54
+ }
55
+
56
  # Generate content
57
  response = model.generate_content(
58
  [
 
65
  "top_k": 40,
66
  "max_output_tokens": 8192,
67
  },
68
+ safety_settings=safety_settings
 
 
69
  )
70
 
71
  # Process response