Skip to content

Commit af32fdf

Browse files
committed
Fix nbfmt
1 parent c17ec4a commit af32fdf

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

TxGemma/[TxGemma]Agentic_Demo_with_Hugging_Face.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@
613613
"name": "stdout",
614614
"output_type": "stream",
615615
"text": [
616-
"Instructions: Answer the following question about drug properties.\n",
616+
"Instructions: Answer the following question about drug properties.\n",
617617
"Context: As a membrane separating circulating blood and brain extracellular fluid, the blood-brain barrier (BBB) is the protection layer that blocks most foreign drugs. Thus the ability of a drug to penetrate the barrier to deliver to the site of action forms a crucial challenge in development of drugs for central nervous system.\n",
618618
"Question: Given a drug SMILES string, predict whether it\n",
619619
"(A) does not cross the BBB (B) crosses the BBB\n",
@@ -636,17 +636,17 @@
636636
"def txgemma_predict(prompt):\n",
637637
" input_ids = predict_tokenizer(prompt, return_tensors=\"pt\").to(\"cuda\")\n",
638638
" outputs = predict_model.generate(**input_ids, max_new_tokens=8)\n",
639-
" return predict_tokenizer.decode(outputs[0][len(input_ids[0]):], skip_special_tokens=True)\n",
639+
" return predict_tokenizer.decode(outputs[0][len(input_ids[0]):], skip_special_tokens=True)\n",
640640
"\n",
641641
"def txgemma_chat(prompt):\n",
642-
" messages = [{\"role\": \"user\", \"content\": prompt}]\n",
643-
" inputs = chat_tokenizer.apply_chat_template(\n",
644-
" messages, tokenize=True, add_generation_prompt=True, return_tensors=\"pt\"\n",
645-
" ).to(\"cuda\")\n",
642+
" messages = [{\"role\": \"user\", \"content\": prompt}]\n",
643+
" inputs = chat_tokenizer.apply_chat_template(\n",
644+
" messages, tokenize=True, add_generation_prompt=True, return_tensors=\"pt\"\n",
645+
" ).to(\"cuda\")\n",
646646
" outputs = chat_model.generate(input_ids=inputs, max_new_tokens=200)\n",
647647
" return chat_tokenizer.decode(outputs[0, len(inputs[0]):], skip_special_tokens=True)\n",
648648
"\n",
649-
"print(TDC_PROMPT)\n",
649+
"print(TDC_PROMPT)\n",
650650
"print(f\"\\nPrediction model response: {txgemma_predict(TDC_PROMPT)}\")\n",
651651
"if USE_CHAT: print(f\"\\nChat model response: {txgemma_chat(TDC_PROMPT)}\")"
652652
]
@@ -1251,7 +1251,7 @@
12511251
"**Conclusion:**\n",
12521252
"\n",
12531253
"For a drug to be considered for broad development, a favorable safety and toxicity profile is paramount. **Aspirin (Drug 1)** has a demonstrably superior safety profile compared to Vorinostat (Drug 2). Its wide range of proven therapeutic benefits and lower toxicity make it the unequivocally preferred candidate for further development over a compound with predicted toxicity and a more niche, high-risk therapeutic application.\n"
1254-
]
1254+
]
12551255
}
12561256
],
12571257
"source": [

TxGemma/[TxGemma]Quickstart_with_Model_Garden.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"\n",
6969
"- Deploy TxGemma to a Vertex AI Endpoint and get online predictions.\n",
7070
"- Upload TxGemma to Vertex AI Model Registry and get batch predictions.\n",
71-
"\n",
71+
"\n",
7272
"### Costs\n",
7373
"\n",
7474
"This tutorial uses billable components of Google Cloud:\n",

0 commit comments

Comments
 (0)