gabrielchua commited on
Commit
1c3a9ea
·
verified ·
1 Parent(s): b966c37

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -2
README.md CHANGED
@@ -57,13 +57,16 @@ from google import genai
57
  # Load model directly from HF
58
  model = AutoModel.from_pretrained("govtech/lionguard-2.1", trust_remote_code=True)
59
 
 
 
 
60
  # Get embeddings (users to input their own Gemini API key)
61
  client = genai.Client(api_key=os.getenv("GEMINI_API_KEY"))
62
- result = client.models.embed_content(
63
  model="gemini-embedding-001",
64
  contents=texts
65
  )
66
- embeddings = np.array([emb.values for emb in result.embeddings])
67
 
68
  # Run inference
69
  results = model.predict(embeddings)
 
57
  # Load model directly from HF
58
  model = AutoModel.from_pretrained("govtech/lionguard-2.1", trust_remote_code=True)
59
 
60
+ # Text to classify
61
+ texts = ["hello", "world"]
62
+
63
  # Get embeddings (users to input their own Gemini API key)
64
  client = genai.Client(api_key=os.getenv("GEMINI_API_KEY"))
65
+ response = client.models.embed_content(
66
  model="gemini-embedding-001",
67
  contents=texts
68
  )
69
+ embeddings = np.array([emb.values for emb in response.embeddings])
70
 
71
  # Run inference
72
  results = model.predict(embeddings)