Skip to content

Commit

Permalink
update settings and extensions in devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
ilude committed Apr 20, 2024
1 parent d7c0723 commit adadde9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 30 deletions.
26 changes: 16 additions & 10 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,28 @@
"customizations": {
"vscode": {
"extensions": [
"eamodio.gitlens",
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
"jeff-hykin.better-dockerfile-syntax",
"ms-azuretools.vscode-docker",
"ms-vsliveshare.vsliveshare",
"mikestead.dotenv",
"EditorConfig.EditorConfig",
"redhat.vscode-yaml",
"redhat.ansible",
"ms-azuretools.vscode-docker",
"ms-toolsai.jupyter",
"ms-python.autopep8",
"streetsidesoftware.code-spell-checker",
"eamodio.gitlens",
"ms-vsliveshare.vsliveshare",
"nhoizey.gremlins",
"esbenp.prettier-vscode",
"peakchen90.open-html-in-browser"
"peakchen90.open-html-in-browser",
"redhat.ansible",
"redhat.vscode-yaml",
"ms-python.black-formatter",
"ms-python.isort"
],
"settings": {
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.detectIndentation": false,
"editor.insertSpaces": false,
"editor.tabSize": 2
},
"files.exclude": {
"**/.dotnet": true,
"**/.zcompdump": true
Expand Down
41 changes: 21 additions & 20 deletions notebooks/ai_prompt.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -16,12 +16,12 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
"items = [\n",
"{'title': 'OPEN THREAD: Just do it.', 'summary': 'OPEN THREAD: Just do it.'},\n",
"{'title': 'OPEN THREAD: Just do it.', 'summary': 'OPEN THREAD: Just do it. #OpenThread #OpenAI'},\n",
"{'title': 'THIS PARAGRAPH CAPTURES THE ESSENCE OF THE ATLANTIC’S SAD PIECE ON THE WORLD’S BIGGEST CRUISE SHIP:', 'summary': 'THIS PARAGRAPH CAPTURES THE ESSENCE OF THE ATLANTIC’S SAD PIECE ON THE WORLD’S BIGGEST CRUISE SHIP: “A real journalist or a more intrepid conversationalist would have gone up to the couple and asked them to explain the longevity of their marriage vis-à-vis their love of cruising. But instead I head to my mall suite, take […]'},\n",
"{'title': 'THE NEW SPACE RACE: China launches first of a new series of Yaogan reconnaissance satellites.', 'summary': 'THE NEW SPACE RACE: China launches first of a new series of Yaogan reconnaissance satellites.'},\n",
"{'title': 'WHY IS THE BIDEN ADMINISTRATION TRYING SO HARD TO KEEP HAMAS FROM LOSING? Biden Calls for Ceasefire', 'summary': 'WHY IS THE BIDEN ADMINISTRATION TRYING SO HARD TO KEEP HAMAS FROM LOSING? Biden Calls for Ceasefire During Phone Call with Netanyahu.'},\n",
Expand All @@ -36,19 +36,19 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
"ollama_url = os.getenv('OLLAMA_URL')\n",
"#model_name = \"tinydolphin\"\n",
"model_name = \"dolphin-mistral\"\n",
"model = Ollama(base_url=ollama_url, model=model_name, keep_alive=5, temperature=0.0)"
"model_name = \"llama3:8b-instruct-q5_0\"\n",
"#model_name = \"dolphin-mistral\"\n",
"model = Ollama(base_url=ollama_url, model=model_name, keep_alive=5,verbose=True, temperature=8)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 29,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -65,8 +65,9 @@
"# format chat prompt\n",
"system_prompt = SystemMessage(content=(\"\"\"\n",
"\tYou are an expert news article title editor.\n",
" Use the provided title and summary to write a concise and accurate title that is concise, informative and avoids sounding like clickbait. \n",
" Use the provided title and summary to write an accurate title that is concise, informative and avoids sounding like clickbait. \n",
"\tDo not include links or urls in the title.\n",
"\tDo not replace hashtags, place any hashtags in the title at the end of the new title.\n",
"\tTitle should be as short as possible, aim to be less that 70 characters long.\n",
"\tTitle should have an absolute minimum of punctuation and use at most one all capitalized word at the start of the title.\n",
"\t\"\"\"))\n",
Expand All @@ -78,23 +79,23 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 30,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 1: OPEN THREAD: Just Do It.\n",
" 2: World's Biggest Cruise Ship: A Couple's Longevity and Love for Cruising\n",
" 1: Open Thread: Take Action\n",
" 2: Cruise Ship's Biggest Mystery: A Couple's Enduring Marriage\n",
" 3: China Launches First Yaogan Reconnaissance Satellite in New Series\n",
" 4: Biden Calls for Ceasefire Amid Hamas-Israel Conflict\n",
" 5: World War II Naval Odyssey: A Thrilling Read\n",
" 6: Taiwan's Tallest Skyscraper Stands Firm in Earthquake: Tuned Mass Dampers at Work\n",
" 7: Thinking You Look Younger Linked to Aging Rate\n",
" 8: NASA's Clipper Prepares for Europa Mission\n",
" 9: 2020 Election Rigging: Consequences for the Cabal\n",
"10: Gut Microbes Linked to Obesity Risk\n"
" 4: Biden Calls for Ceasefire Amid Gaza Tensions\n",
" 5: Book Review: The Naval Odyssey of Prof. James Brand\n",
" 6: Steel Ball Saves Taiwan's Tallest Skyscraper in Earthquake\n",
" 7: Perception of Youthfulness Linked to Biological Aging\n",
" 8: NASA's Clipper Prepares for Europa Mission: A Journey to the Unknown\n",
" 9: Rigging the Election: Consequences Loom for Bragging Cabal\n",
"10: Gut Microbes May Influence Obesity Risk\n"
]
}
],
Expand All @@ -103,7 +104,7 @@
"for item in items:\n",
" data.append({\"data\": json.dumps(item)})\n",
"\n",
"rows = chain.batch(data, max_concurrency=len(data))\n",
"rows = chain.batch(data, max_concurrency=len(data), )\n",
"\n",
"index = 1\n",
"for row in rows:\n",
Expand Down

0 comments on commit adadde9

Please sign in to comment.