Open rafi-rr opened 2 months ago
Adding an example for such an exception during the embeddings creation flow:
"File \"/.../lib/python3.11/site-packages/vertexai/generative_models/_generative_models.py\", line 1977, in text", " 1974 @property", " 1975 def text(self) -> str:", " 1976 try:", "--> 1977 return self.content.text", " 1978 except (ValueError, AttributeError) as e:", " ..................................................", " self = finish_reason: SAFETY", " safety_ratings {", " category: HARM_CATEGORY_HATE_SPEECH", " probability: NEGLIGIBLE", " probability_score: 0.124023438", " severity: HARM_SEVERITY_NEGLIGIBLE", " severity_score: 0.15234375", " }", " safety_ratings {", " category: HARM_CATEGORY_DANGEROUS_CONTENT", " probability: HIGH", " blocked: true", " probability_score: 0.87890625", " severity: HARM_SEVERITY_LOW", " severity_score: 0.3046875", " }", " safety_ratings {", " category: HARM_CATEGORY_HARASSMENT", " probability: NEGLIGIBLE", " probability_score: 0.1621...", " self.content.text = # ValueError", " self.content = ",
The content of the tables far from being harmful or dangerous.
This should be resolved, as safety filters should be unblocked by default as of now. @rafi-rr can you verify?
@5Y5TEM Still not resolved in v2.0.0 Happened again in a new project that doesn't have the security filters disabled. It fails during initialization with "InvalidArgument: 400 User has requested a restricted HarmBlockThreshold setting BLOCK_NONE."
When running
python env_setup.py
(either v1 or v2), the flow stops due to the following error:This can be resolved by setting
HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE
but should either be avoided or allow to be configured.Thanks.