Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keras 3 migration #1716

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Keraas 3 migration
  • Loading branch information
sachinprasadhs committed Jan 7, 2024
commit 195895c035148edf3bc1a71a7366c6e9acf4e5b9
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
"\n",
"**Author:** Md Awsafur Rahman<br>\n",
"**Date created:** 2023/09/14<br>\n",
"**Last modified:** 2023/09/14<br>\n",
"**Last modified:** 2024/01/06<br>\n",
"**Description:** Use pre-trained nlp models for multiplechoice task."
]
},
@@ -45,9 +45,20 @@
},
"outputs": [],
"source": [
"import keras_nlp\n",
"!pip install -q keras-nlp --upgrade"
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"colab_type": "code"
},
"outputs": [],
"source": [
"import keras\n",
"import tensorflow as tf # For tf.data only.\n",
"import keras_nlp\n",
"import tensorflow as tf\n",
"\n",
"import numpy as np\n",
"import pandas as pd\n",
@@ -856,9 +867,9 @@
" question = row.startphrase\n",
" pred_answer = f\"ending{pred_answers[i]}\"\n",
" true_answer = f\"ending{true_answers[i]}\"\n",
" print(f\"\u2753 Sentence {i+1}:\\n{question}\\n\")\n",
" print(f\"\u2705 True Ending: {true_answer}\\n >> {row[true_answer]}\\n\")\n",
" print(f\"\ud83e\udd16 Predicted Ending: {pred_answer}\\n >> {row[pred_answer]}\\n\")\n",
" print(f\"\u2753 Sentence {i+1}:\\n{question}\\n\")\n",
" print(f\"\u2705 True Ending: {true_answer}\\n >> {row[true_answer]}\\n\")\n",
" print(f\"\ud83e\udd16 Predicted Ending: {pred_answer}\\n >> {row[pred_answer]}\\n\")\n",
" print(\"-\" * 90, \"\\n\")"
]
},
Loading
Loading