Skip to content

Commit

Permalink
test notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
hudson-ai committed Feb 21, 2025
1 parent 82c2e97 commit 10ddf70
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions guidance/experimental/test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@
"metadata": {},
"outputs": [],
"source": [
"from PIL import Image as PILImage\n",
"import requests\n",
"from io import BytesIO\n",
"from guidance import *\n",
"\n",
"from guidance.experimental.ast import ImageBlob"
"from huggingface_hub import hf_hub_download\n",
"model_path = hf_hub_download(\"lmstudio-community/Phi-3.1-mini-4k-instruct-GGUF\", \"Phi-3.1-mini-4k-instruct-IQ3_M.gguf\")"
]
},
{
Expand All @@ -21,11 +18,8 @@
"outputs": [],
"source": [
"# model = models.Transformers(\"microsoft/Phi-3-mini-4k-instruct\", trust_remote_code=True, attn_implementation=\"eager\")\n",
"# model = models.OpenAI(\"gpt-4o-mini\")\n",
"\n",
"from huggingface_hub import hf_hub_download\n",
"model_path = hf_hub_download(\"lmstudio-community/Phi-3.1-mini-4k-instruct-GGUF\", \"Phi-3.1-mini-4k-instruct-IQ3_M.gguf\")\n",
"model = models.LlamaCpp(model_path)"
"model = models.OpenAI(\"gpt-4o-mini\")\n",
"# model = models.LlamaCpp(model_path)"
]
},
{
Expand All @@ -44,7 +38,20 @@
"with user():\n",
" lm += \"What is the capital of France?\"\n",
"with assistant():\n",
" lm += gen()\n",
" lm += gen()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# from PIL import Image as PILImage\n",
"# import requests\n",
"# from io import BytesIO\n",
"# from guidance.experimental.ast import ImageBlob\n",
"\n",
"# with user():\n",
"# lm += \"Can you describe the contents of this image?\"\n",
"# lm += ImageBlob(image=PILImage.open(BytesIO(requests.get(\"https://picsum.photos/300/200\").content)))\n",
Expand Down Expand Up @@ -78,6 +85,13 @@
"source": [
"lm._state.active_message"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 10ddf70

Please sign in to comment.