"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

June 15, 2023

GCP Vertex Text Examples

#!pip install "shapely<2.0.0"
#!pip install google-cloud-aiplatform
import vertexai
from vertexai.language_models import TextGenerationModel
vertexai.init(project="cohesive-gadget-166410", location="us-central1")
parameters = {
"temperature": 0.2,
"max_output_tokens": 256,
"top_p": 0.8,
"top_k": 40
}
text = "Create one liner add for below product. Product meta data is - 2 IN 1 USB CARD READER - Whether Trans Flash or SD, enjoy the power to read and write on two cards simultaneously, and avoid constantly plugging in and out. HIGH-SPEED TRANSMISSION SPEED - USB 3.0 gives you access to Super Speed data transfer rates of up to 5Gbps with all enabled cards. CARD COMPATIBILITY - Support SD/SDHC/SDXCMMC/MMC…¡/RS MMC/MMC 4.0/ Ultra …¡ SD/ Extreme SD/ Extreme … SD /T-Flash / MICRO SDHC/MICRO SDXC 35/5000,Through the adapter can also read MINI SD / MMC micro Card. DESIGN WITH OTG - Truly plug & play of this OTG card reader. Easy installation with no device driver necessary, even the elderly don't have to worry about how to use it.Ideal for transferring high-resolution images and video recordings.."
model = TextGenerationModel.from_pretrained("text-bison@001")
response = model.predict(
text,
**parameters
)
print(f"Response from Model: {response.text}")
#Response from Model: **2-in-1 USB 3.0 Card Reader: Read and write on two cards simultaneously at blazing fast speeds up to 5Gbps.**

 





Keep Exploring!!!

No comments: