-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
95 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
"nbformat": 4, | ||
"nbformat_minor": 0, | ||
"metadata": { | ||
"colab": { | ||
"provenance": [], | ||
"gpuType": "T4" | ||
}, | ||
"kernelspec": { | ||
"name": "python3", | ||
"display_name": "Python 3" | ||
}, | ||
"language_info": { | ||
"name": "python" | ||
}, | ||
"accelerator": "GPU" | ||
}, | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": { | ||
"colab": { | ||
"base_uri": "https://localhost:8080/" | ||
}, | ||
"id": "tlg9YpBgnLhE", | ||
"outputId": "895188c2-bdeb-4f0f-bb94-d928a32d07b3" | ||
}, | ||
"outputs": [ | ||
{ | ||
"output_type": "stream", | ||
"name": "stdout", | ||
"text": [ | ||
" ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 73.4/73.4 kB 3.3 MB/s eta 0:00:00\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"%%bash\n", | ||
"pip install -qq -U text2text" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"from text2text.langchain.text2text_assistant import Text2TextAssistant\n", | ||
"input_text = \"\"\"\n", | ||
"I have a clove of garlic, some brown rice, a few baby bok choy,\n", | ||
"some olive oil, and a few slices of bacon.\n", | ||
"How can I prepare a meal our of these ingredients?\n", | ||
"\"\"\"\n", | ||
"llm = Text2TextAssistant()\n", | ||
"result = llm(input_text)\n", | ||
"print(result)" | ||
], | ||
"metadata": { | ||
"colab": { | ||
"base_uri": "https://localhost:8080/" | ||
}, | ||
"id": "a8aELPRAo4HP", | ||
"outputId": "5296cfe9-2b9e-4929-aaa0-ce5a7d5b2420" | ||
}, | ||
"execution_count": 6, | ||
"outputs": [ | ||
{ | ||
"output_type": "stream", | ||
"name": "stdout", | ||
"text": [ | ||
"You could make a delicious garlic fried rice with bok choy and bacon! Here's a recipe to follow:\n", | ||
"\n", | ||
"Ingredients:\n", | ||
"\n", | ||
"* 1/2 cup of cooked brown rice\n", | ||
"* 1 small clove of garlic, minced\n", | ||
"* 1/2 cup of baby bok choy, thinly sliced\n", | ||
"* 4-5 slices of bacon, diced\n", | ||
"* 2 tablespoons of olive oil\n", | ||
"* Salt and pepper, to taste\n", | ||
"\n", | ||
"Instructions:\n", | ||
"\n", | ||
"1. Heat the olive oil in a large skillet over medium heat. Add the minced garlic and sauté for about 30 seconds until fragrant.\n", | ||
"2. Add the diced bacon to the skillet and cook for about 3-4 minutes or until crispy. Remove from the skillet and set aside.\n", | ||
"3. In the same skillet, add the sliced bok choy and cook for about 3-4 minutes or until wilted. Season with salt and pepper to taste.\n", | ||
"4. Add the cooked brown rice to the skillet and stir to combine with the bok choy and bacon. Cook for an additional 2-3 minutes or until heated through.\n", | ||
"5. Serve hot and enjoy your delicious garlic fried rice with bok choy and bacon!\n" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters