Skip to content

Commit

Permalink
reducing temperature, changing prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjanalreddy committed May 21, 2024
1 parent 17711d3 commit 2260630
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"outputs": [],
"source": [
"parameters = {\n",
" \"temperature\": 0.5, # Temperature controls the degree of randomness in token selection.\n",
" \"temperature\": 0.2, # Temperature controls the degree of randomness in token selection.\n",
" \"max_output_tokens\": 256, # Token limit determines the maximum amount of text output.\n",
" \"top_p\": 0.8, # Tokens are selected from most probable to least until the sum of their probabilities equals the top_p value.\n",
" \"top_k\": 40, # A top_k of 1 means the selected token is the most probable among all tokens.\n",
Expand Down Expand Up @@ -300,8 +300,8 @@
},
"outputs": [],
"source": [
"PROMPT = \"What are managed datasets in Vertex AI?\"\n",
"PROMPT_FOLLOWUP = \"What types of data can I use\""
"PROMPT = \"How can I ground LLM responses in Vertex AI?\"\n",
"PROMPT_FOLLOWUP = \"What types of data can I use for grounding?\""
]
},
{
Expand All @@ -323,9 +323,11 @@
"source": [
"chat = chat_model.start_chat()\n",
"\n",
"print(f\"PROMPT: {PROMPT}\")\n",
"response = chat.send_message(PROMPT)\n",
"print(response.text)\n",
"\n",
"print(f\"PROMPT: {PROMPT_FOLLOWUP}\")\n",
"response = chat.send_message(PROMPT_FOLLOWUP)\n",
"print(response.text)"
]
Expand Down Expand Up @@ -354,13 +356,15 @@
" data_store_id=DATA_STORE_ID, location=DATA_STORE_REGION\n",
")\n",
"\n",
"print(f\"PROMPT: {PROMPT}\")\n",
"response = chat.send_message(\n",
" PROMPT,\n",
" grounding_source=grounding_source,\n",
")\n",
"print(response.text)\n",
"print(response.grounding_metadata)\n",
"\n",
"print(f\"PROMPT: {PROMPT_FOLLOWUP}\")\n",
"response = chat.send_message(\n",
" PROMPT_FOLLOWUP,\n",
" grounding_source=grounding_source,\n",
Expand Down

0 comments on commit 2260630

Please sign in to comment.