Unexpected error when using VertexAI Text-Unicorn

I have recently started to get the following errors when I run this code. 

Example:

import vertexai from vertexai.language_models 
import TextGenerationModel
vertexai.init(project="*", location="us-central1")
parameters = { "max_output_tokens": 1024, "temperature": 1, "top_k": 40 }
model = TextGenerationModel.from_pretrained("text-unicorn@001")
responses = model.predict_streaming( """Why does the fundus rise when the placenta separates?""", **parameters )
results = []
for response in responses:
print(response)
results.append(str(response))

I got a correct response when I submitted the above on VertexAI Console. When I run it on my computer (and other multiple locations), I get the following error often in the middle of the stream:

TextGenerationResponse(text='', is_blocked=True, errors=(), safety_attributes={}, grounding_metadata=GroundingMetadata(citations=[], search_queries=[]))

Other information (workarounds you have tried, documentation consulted, etc):
- I have tried adjusting the safety settings within the VertexAI Console, but I cannot reproduce it.
- I have run the code on multiple machines and Collab workspaces.
- I have tried adjusting the weights and "max_output_tokens", "temperature" and "top_k".

3 0 182
0 REPLIES 0