Browse Source

Wk1 Day2 Exercise Ollama solution

pull/125/head
266367 3 months ago
parent
commit
fe1a0d79ac
  1. 12
      week1/community-contributions/wk1-day1-deepseek-stream-summarize.ipynb

12
week1/community-contributions/wk1-day1-deepseek-stream-summarize.ipynb

@ -15,9 +15,15 @@
"from openai import OpenAI\n", "from openai import OpenAI\n",
"\n", "\n",
"load_dotenv(override=True)\n", "load_dotenv(override=True)\n",
"api_key = os.getenv('DEEPSEEK_API_KEY')\n", "# Deep seek API payload\n",
"base_url=os.getenv('DEEPSEEK_BASE_URL')\n", "# api_key = os.getenv('DEEPSEEK_API_KEY')\n",
"MODEL = \"deepseek-chat\"\n", "# base_url=os.getenv('DEEPSEEK_BASE_URL')\n",
"# MODEL = \"deepseek-chat\"\n",
"\n",
"# Day 2 Exercise with Ollama API\n",
"api_key = os.getenv('OLLAMA_API_KEY')\n",
"base_url = os.getenv('OLLAMA_BASE_URL')\n",
"MODEL = \"llama3.2\"\n",
"\n", "\n",
"system_prompt = \"You are an assistant that analyzes the contents of a website \\\n", "system_prompt = \"You are an assistant that analyzes the contents of a website \\\n",
"and provides a short summary, ignoring text that might be navigation related. \\\n", "and provides a short summary, ignoring text that might be navigation related. \\\n",

Loading…
Cancel
Save