File size: 35,140 Bytes
a6576f0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "7d423f7b-730c-4669-be82-c0a7141b7c76",
   "metadata": {},
   "source": [
    "# Analyze sentiment driving posts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "83e1a76f-45a1-44d9-ae4a-62425a7af45d",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-06-06T18:19:44.555148Z",
     "iopub.status.busy": "2025-06-06T18:19:44.555148Z",
     "iopub.status.idle": "2025-06-06T18:19:45.754942Z",
     "shell.execute_reply": "2025-06-06T18:19:45.754942Z",
     "shell.execute_reply.started": "2025-06-06T18:19:44.555148Z"
    }
   },
   "outputs": [],
   "source": [
    "import os\n",
    "import glob\n",
    "import datetime\n",
    "from pathlib import Path\n",
    "from dotenv import load_dotenv\n",
    "import pandas as pd\n",
    "import pyarrow\n",
    "\n",
    "from huggingface_hub import HfApi"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "c808621b-f55a-4a80-8011-420c0be55151",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-06-06T18:25:14.801890Z",
     "iopub.status.busy": "2025-06-06T18:25:14.801890Z",
     "iopub.status.idle": "2025-06-06T18:25:14.811651Z",
     "shell.execute_reply": "2025-06-06T18:25:14.811651Z",
     "shell.execute_reply.started": "2025-06-06T18:25:14.801890Z"
    }
   },
   "outputs": [],
   "source": [
    "\"\"\"\n",
    "Download a single subreddit-day Parquet file from\n",
    "`hblim/top_reddit_posts_daily/data_scored_subreddit/`.\n",
    "\n",
    "Prereqs\n",
    "-------\n",
    "pip install huggingface_hub pandas pyarrow\n",
    "huggingface-cli login  # or set HF_TOKEN\n",
    "\"\"\"\n",
    "\n",
    "from __future__ import annotations\n",
    "\n",
    "import re\n",
    "from pathlib import Path\n",
    "from typing import Optional\n",
    "\n",
    "import pandas as pd\n",
    "from huggingface_hub import HfApi, hf_hub_download\n",
    "\n",
    "\n",
    "def _sanitize(sub: str) -> str:\n",
    "    \"\"\"\n",
    "    Apply the same cleaning rule that was used when the shards were created\n",
    "    (lowercase + replace any char that isn't 0-9, a-z, _, -, . with '_').\n",
    "    \"\"\"\n",
    "    return re.sub(r\"[^\\w\\-.]\", \"_\", sub.strip().lower())\n",
    "\n",
    "\n",
    "def download_subreddit_day(\n",
    "    date_str: str,              # \"YYYY-MM-DD\"\n",
    "    subreddit: str,             # e.g. \"MachineLearning\"\n",
    "    repo_id: str = \"hblim/top_reddit_posts_daily\",\n",
    "    data_folder: str = \"data_scored_subreddit\",\n",
    "    out_dir: str | Path = \"downloads\",\n",
    "    token: Optional[str] = None,\n",
    ") -> Path:\n",
    "    \"\"\"\n",
    "    Returns the local path of the downloaded Parquet file.\n",
    "\n",
    "    Raises FileNotFoundError if the shard isn't on the Hub.\n",
    "    \"\"\"\n",
    "    api = HfApi(token=token)\n",
    "    safe_sub = _sanitize(subreddit)\n",
    "\n",
    "    # remote path is exactly how the splitter wrote it: YYYY-MM-DD__sub.parquet\n",
    "    filename_in_repo = f\"{data_folder}/{date_str}__{safe_sub}.parquet\"\n",
    "\n",
    "    # sanity check: make sure the file exists in the repo\n",
    "    if filename_in_repo not in api.list_repo_files(repo_id, repo_type=\"dataset\"):\n",
    "        raise FileNotFoundError(\n",
    "            f\"No shard named '{filename_in_repo}' in {repo_id}. \"\n",
    "            \"Maybe the date or subreddit is wrong?\"\n",
    "        )\n",
    "\n",
    "    local_path = hf_hub_download(\n",
    "        repo_id=repo_id,\n",
    "        filename=filename_in_repo,\n",
    "        repo_type=\"dataset\",\n",
    "        cache_dir=str(Path(out_dir).expanduser()),\n",
    "    )\n",
    "    print(f\"✅ Downloaded to: {local_path}\")\n",
    "    return Path(local_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "id": "e64146ea-4bdc-461b-9c27-99aaac5a50a8",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-06-07T01:10:47.720639Z",
     "iopub.status.busy": "2025-06-07T01:10:47.720639Z",
     "iopub.status.idle": "2025-06-07T01:10:48.845012Z",
     "shell.execute_reply": "2025-06-07T01:10:48.845012Z",
     "shell.execute_reply.started": "2025-06-07T01:10:47.720639Z"
    }
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a07b9648bd3b4454ad05b564e304ca76",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "2025-06-06__localllama.parquet:   0%|          | 0.00/69.2k [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "✅ Downloaded to: downloads\\datasets--hblim--top_reddit_posts_daily\\snapshots\\5fc94d45ca6e670268f2e505350bbc08ec7d5d84\\data_scored_subreddit\\2025-06-06__localllama.parquet\n"
     ]
    }
   ],
   "source": [
    "subreddit = 'localllama'\n",
    "date = '2025-06-06'\n",
    "path = download_subreddit_day(\n",
    "        date_str=date,\n",
    "        subreddit=subreddit)\n",
    "df = pd.read_parquet(path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "id": "6c41a5bc-0169-491b-ac26-bc7edae8f852",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-06-07T01:10:49.801513Z",
     "iopub.status.busy": "2025-06-07T01:10:49.801513Z",
     "iopub.status.idle": "2025-06-07T01:10:49.851213Z",
     "shell.execute_reply": "2025-06-07T01:10:49.851213Z",
     "shell.execute_reply.started": "2025-06-07T01:10:49.801513Z"
    }
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\halst\\AppData\\Local\\Temp\\ipykernel_23912\\1682697236.py:32: DeprecationWarning: DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated, and in a future version of pandas the grouping columns will be excluded from the operation. Either pass `include_groups=False` to exclude the groupings or explicitly select the grouping columns after groupby to silence this warning.\n",
      "  thread_metrics = grouped.apply(lambda group: pd.Series({\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "# Assume 'df' is already loaded in the notebook, e.g.:\n",
    "# df = pd.read_csv(\"my_reddit_day.csv\")\n",
    "\n",
    "def compute_metrics_for_df(df, gamma_post=0.3):\n",
    "    # 1. Ensure 'score' is numeric\n",
    "    df['score_num'] = pd.to_numeric(df['score'], errors='coerce').fillna(0)\n",
    "\n",
    "    # 2. Compute weights: log-scaled by score, with a lower multiplier for posts\n",
    "    weights = (1 + np.log1p(df['score_num'].clip(lower=0)))\n",
    "    weights *= np.where(df['type'] == 'post', gamma_post, 1.0)\n",
    "    df['weight'] = weights\n",
    "\n",
    "    # 3. Compute a thread_id for each row\n",
    "    def thread_id(row):\n",
    "        if row['type'] == 'post':\n",
    "            return str(row['post_id'])\n",
    "        pid = row['parent_id']\n",
    "        if isinstance(pid, str) and pid.startswith('t3_'):\n",
    "            return pid[3:]\n",
    "        return str(pid)\n",
    "\n",
    "    df['thread_id'] = df.apply(thread_id, axis=1)\n",
    "\n",
    "    # 4. Overall daily weighted sentiment (EAS)\n",
    "    day_eas = (df['weight'] * df['sentiment']).sum() / df['weight'].sum()\n",
    "\n",
    "    # 5. Per-thread metrics\n",
    "    grouped = df.groupby('thread_id')\n",
    "    thread_metrics = grouped.apply(lambda group: pd.Series({\n",
    "        'eas': (group['weight'] * group['sentiment']).sum() / group['weight'].sum(),\n",
    "        'tot_weight': group['weight'].sum(),\n",
    "        'title': (\n",
    "            group.loc[group['type'] == 'post', 'text']\n",
    "                 .iloc[0]\n",
    "            if (group['type'] == 'post').any()\n",
    "            else ''\n",
    "        )\n",
    "    })).reset_index()\n",
    "\n",
    "    # 6. Contribution: how much each thread shifts the day sentiment from 0.5\n",
    "    thread_metrics['contrib'] = thread_metrics['tot_weight'] * (thread_metrics['eas'] - 0.5)\n",
    "\n",
    "    return day_eas, thread_metrics\n",
    "\n",
    "# === Example usage on your preloaded DataFrame ===\n",
    "day_eas_value, thread_df = compute_metrics_for_df(df)\n",
    "\n",
    "# 7. Show the overall daily sentiment\n",
    "daily_summary = pd.DataFrame([{\n",
    "    'weighted_sentiment (EAS)': round(day_eas_value, 3)\n",
    "}])\n",
    "daily_summary\n",
    "\n",
    "thread_top_pos = thread_df.sort_values('contrib', ascending=False).head(5).copy()\n",
    "thread_top_neg = thread_df.sort_values('contrib').head(5).copy()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "id": "7c32258e-14b4-42d4-a535-b2598e19f968",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-06-07T01:11:03.484174Z",
     "iopub.status.busy": "2025-06-07T01:11:03.480647Z",
     "iopub.status.idle": "2025-06-07T01:11:03.528587Z",
     "shell.execute_reply": "2025-06-07T01:11:03.528587Z",
     "shell.execute_reply.started": "2025-06-07T01:11:03.484174Z"
    }
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\halst\\AppData\\Local\\Temp\\ipykernel_23912\\1682697236.py:32: DeprecationWarning: DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated, and in a future version of pandas the grouping columns will be excluded from the operation. Either pass `include_groups=False` to exclude the groupings or explicitly select the grouping columns after groupby to silence this warning.\n",
      "  thread_metrics = grouped.apply(lambda group: pd.Series({\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>weighted_sentiment (EAS)</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.3186</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   weighted_sentiment (EAS)\n",
       "0                    0.3186"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# === Example usage on your preloaded DataFrame ===\n",
    "day_eas_value, thread_df = compute_metrics_for_df(df)\n",
    "\n",
    "# 7. Show the overall daily sentiment\n",
    "daily_summary = pd.DataFrame([{\n",
    "    'weighted_sentiment (EAS)': round(day_eas_value, 4)\n",
    "}])\n",
    "daily_summary"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "id": "823deb32-cce6-4b1f-aba2-bebdf1645b6e",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-06-07T01:11:45.194222Z",
     "iopub.status.busy": "2025-06-07T01:11:45.188532Z",
     "iopub.status.idle": "2025-06-07T01:11:45.198360Z",
     "shell.execute_reply": "2025-06-07T01:11:45.198360Z",
     "shell.execute_reply.started": "2025-06-07T01:11:45.194222Z"
    }
   },
   "outputs": [],
   "source": [
    "# 8. Extract top 5 positive-contribution threads and top 5 negative-contribution threads\n",
    "thread_top_pos = thread_df.sort_values('contrib', ascending=False).head(5).copy()\n",
    "thread_top_neg = thread_df.sort_values('contrib').head(5).copy()\n",
    "\n",
    "# (Optionally) truncate titles for display\n",
    "# thread_top_pos['title'] = thread_top_pos['title'].str.slice(0, 90)\n",
    "# thread_top_neg['title'] = thread_top_neg['title'].str.slice(0, 90)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "id": "085652c4-b599-4d7b-bc64-e3a464d3d72c",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-06-07T01:12:18.195083Z",
     "iopub.status.busy": "2025-06-07T01:12:18.194068Z",
     "iopub.status.idle": "2025-06-07T01:12:18.201898Z",
     "shell.execute_reply": "2025-06-07T01:12:18.201898Z",
     "shell.execute_reply.started": "2025-06-07T01:12:18.195083Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>title</th>\n",
       "      <th>eas</th>\n",
       "      <th>tot_weight</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>Is this the largest \"No synthetic data\" open weight LLM? (142B)\\n\\nFrom the GitHub page of https://huggingface.co/rednote-hilab/dots.llm1.base</td>\n",
       "      <td>0.579431</td>\n",
       "      <td>28.660264</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Tokasaurus: An LLM Inference Engine for High-Throughput Workloads\\n\\n</td>\n",
       "      <td>0.740024</td>\n",
       "      <td>8.072325</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>Real-time conversation with a character on your local machine\\n\\nAnd also the voice split function\\n\\nSorry for my English =)</td>\n",
       "      <td>0.551828</td>\n",
       "      <td>30.763515</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>Offline verbal chat bot with modular tool calling!\\n\\nThis is an update from my original [post](https://www.reddit.com/r/LocalLLaMA/comments/1l2vrg2/fully_offline_verbal_chat_bot/) where I demoed my fully offline verbal chat bot. I've made a couple updates, and should be releasing it on github soon.  \\n\\- Clipboard insertion: allows you to insert your clipboard to the prompt with just a key press  \\n\\- Modular tool calling: allows the model to use tools that can be drag and dropped into a folder\\n\\nTo clarify how tool calling works: Behind the scenes the program parses the json headers of all files in the tools folder at startup, and then passes them along with the users message. This means you can simply drag and drop a tool, restart the app, and use it.\\n\\nPlease leave suggestions and ask any questions you might have!</td>\n",
       "      <td>0.764096</td>\n",
       "      <td>4.431766</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>I thought Qwen3 was putting out some questionable content into my code...\\n\\nOh. \\*\\*SOLVED.\\*\\*  See why, I think, at the end.\\n\\nOkay, so I was trying \\`aider\\`. Only tried a bit here and there, but I just switched to using \\`Qwen\\_Qwen3-14B-Q6\\_K\\_L.gguf\\`.  And I see this in my aider output:\\n\\n\\`\\`\\`text  \\n\\## Signoff: insurgent (razzin' frazzin' motherfu... stupid directx...)  \\n\\`\\`\\`  \\nNow, please bear in mind, this is script that plots timestamps, like \\`ls | plottimes\\` and, aside from plotting time data as a \\`heatmap\\`, it has no special war or battle terminology, nor profane language in it.  I am not familiar with this thing to know where or how that was generated, since it SEEMS to be from a trial run aider did of the code:\\n\\nhttps://preview.redd.it/zamjz1bdsb5f1.jpg?width=719&amp;format=pjpg&amp;auto=webp&amp;s=5ca874f91bdd6fe7fc20f4eb797e5ddc22500dec\\n\\nBut, that seems to be the code running -- not LLM output directly.\\n\\nOdd!\\n\\n...scrolling back to see what's up there:\\n\\n...</td>\n",
       "      <td>0.719805</td>\n",
       "      <td>4.278161</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      title  \\\n",
       "32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           Is this the largest \"No synthetic data\" open weight LLM? (142B)\\n\\nFrom the GitHub page of https://huggingface.co/rednote-hilab/dots.llm1.base   \n",
       "14                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Tokasaurus: An LLM Inference Engine for High-Throughput Workloads\\n\\n   \n",
       "21                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Real-time conversation with a character on your local machine\\n\\nAnd also the voice split function\\n\\nSorry for my English =)   \n",
       "37                                                                                                                                                                          Offline verbal chat bot with modular tool calling!\\n\\nThis is an update from my original [post](https://www.reddit.com/r/LocalLLaMA/comments/1l2vrg2/fully_offline_verbal_chat_bot/) where I demoed my fully offline verbal chat bot. I've made a couple updates, and should be releasing it on github soon.  \\n\\- Clipboard insertion: allows you to insert your clipboard to the prompt with just a key press  \\n\\- Modular tool calling: allows the model to use tools that can be drag and dropped into a folder\\n\\nTo clarify how tool calling works: Behind the scenes the program parses the json headers of all files in the tools folder at startup, and then passes them along with the users message. This means you can simply drag and drop a tool, restart the app, and use it.\\n\\nPlease leave suggestions and ask any questions you might have!   \n",
       "31  I thought Qwen3 was putting out some questionable content into my code...\\n\\nOh. \\*\\*SOLVED.\\*\\*  See why, I think, at the end.\\n\\nOkay, so I was trying \\`aider\\`. Only tried a bit here and there, but I just switched to using \\`Qwen\\_Qwen3-14B-Q6\\_K\\_L.gguf\\`.  And I see this in my aider output:\\n\\n\\`\\`\\`text  \\n\\## Signoff: insurgent (razzin' frazzin' motherfu... stupid directx...)  \\n\\`\\`\\`  \\nNow, please bear in mind, this is script that plots timestamps, like \\`ls | plottimes\\` and, aside from plotting time data as a \\`heatmap\\`, it has no special war or battle terminology, nor profane language in it.  I am not familiar with this thing to know where or how that was generated, since it SEEMS to be from a trial run aider did of the code:\\n\\nhttps://preview.redd.it/zamjz1bdsb5f1.jpg?width=719&format=pjpg&auto=webp&s=5ca874f91bdd6fe7fc20f4eb797e5ddc22500dec\\n\\nBut, that seems to be the code running -- not LLM output directly.\\n\\nOdd!\\n\\n...scrolling back to see what's up there:\\n\\n...   \n",
       "\n",
       "         eas  tot_weight  \n",
       "32  0.579431   28.660264  \n",
       "14  0.740024    8.072325  \n",
       "21  0.551828   30.763515  \n",
       "37  0.764096    4.431766  \n",
       "31  0.719805    4.278161  "
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "thread_top_pos[['title', 'eas', 'tot_weight']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "id": "4b925100-a077-4178-a826-721677f5461d",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-06-07T01:12:18.509027Z",
     "iopub.status.busy": "2025-06-07T01:12:18.509027Z",
     "iopub.status.idle": "2025-06-07T01:12:18.520061Z",
     "shell.execute_reply": "2025-06-07T01:12:18.519048Z",
     "shell.execute_reply.started": "2025-06-07T01:12:18.509027Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>title</th>\n",
       "      <th>eas</th>\n",
       "      <th>tot_weight</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>Cannot even run the smallest model on system RAM?\\n\\nI am a bit confused. I am trying to run small LLMs on my Unraid server within the Ollama docker, using just the CPU and 16GB of system RAM.\\n\\nGot Ollama up and running, but even when pulling the smallest models like Qwen 3 0.6B with Q4\\_K\\_M quantization, Ollama tells me I need way more RAM than I have left to spare. Why is that? Should this model not be running on any potato? Does this have to do with context overhead?\\n\\n  \\nSorry if this is a stupid question, I am trying to learn more about this and cannot find the solution anywhere else.</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>23.823146</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>what's the case against flash attention?\\n\\nI accidently stumbled upon the -fa (flash attention) flag in llama.cpp's llama-server. I cannot speak to the speedup in performence as i haven't properly tested it, but the memory optimization is huge: 8B-F16-gguf model with 100k fit comfortably in 32GB vram gpu with some 2-3 GB to spare.\\n\\nA very brief search revealed that flash attention theoretically computes the same mathematical function, and in practice benchmarks show no change in the model's output quality.\\n\\nSo my question is, is flash attention really just free lunch? what's the catch? why is it not enabled by default?</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>22.075726</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>It is possble to run non-reasoning deepseek-r1-0528?\\n\\nI know, stupid question, but couldn't find an answer to it!</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>17.520515</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Can a model be so radically altered that its origin can no longer be recognized? YES!\\n\\n**Phi-lthy4**( [https://huggingface.co/SicariusSicariiStuff/Phi-lthy4](https://huggingface.co/SicariusSicariiStuff/Phi-lthy4) ) has been consistently described as **exceptionally unique** by all who have tested it, **almost devoid of SLOP**, and it is now widely regarded as the **most unique roleplay model available**. It underwent an intensive continued pretraining (CPT) phase, extensive supervised fine-tuning (SFT) on high-quality organic datasets, and leveraged advanced techniques including model merging, parameter pruning, and upscaling.\\n\\nInterestingly, this distinctiveness was validated in a recent paper: [*Gradient-Based Model Fingerprinting for LLM Similarity Detection and Family Classification*](https://arxiv.org/html/2506.01631v1). Among a wide array of models tested, this one stood out as **unclassifiable** by traditional architecture-based fingerprinting—highlighting the extent of ...</td>\n",
       "      <td>0.211321</td>\n",
       "      <td>27.502412</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>China's Rednote Open-source dots.llm performance &amp; cost\\n\\n\\nhttps://github.com/rednote-hilab/dots.llm1/blob/main/dots1_tech_report.pdf</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>15.465402</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      title  \\\n",
       "23                                                                                                                                                                                                                                                                                                                                                                                                               Cannot even run the smallest model on system RAM?\\n\\nI am a bit confused. I am trying to run small LLMs on my Unraid server within the Ollama docker, using just the CPU and 16GB of system RAM.\\n\\nGot Ollama up and running, but even when pulling the smallest models like Qwen 3 0.6B with Q4\\_K\\_M quantization, Ollama tells me I need way more RAM than I have left to spare. Why is that? Should this model not be running on any potato? Does this have to do with context overhead?\\n\\n  \\nSorry if this is a stupid question, I am trying to learn more about this and cannot find the solution anywhere else.    \n",
       "36                                                                                                                                                                                                                                                                                                                                                                                  what's the case against flash attention?\\n\\nI accidently stumbled upon the -fa (flash attention) flag in llama.cpp's llama-server. I cannot speak to the speedup in performence as i haven't properly tested it, but the memory optimization is huge: 8B-F16-gguf model with 100k fit comfortably in 32GB vram gpu with some 2-3 GB to spare.\\n\\nA very brief search revealed that flash attention theoretically computes the same mathematical function, and in practice benchmarks show no change in the model's output quality.\\n\\nSo my question is, is flash attention really just free lunch? what's the catch? why is it not enabled by default?   \n",
       "17                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      It is possble to run non-reasoning deepseek-r1-0528?\\n\\nI know, stupid question, but couldn't find an answer to it!   \n",
       "13  Can a model be so radically altered that its origin can no longer be recognized? YES!\\n\\n**Phi-lthy4**( [https://huggingface.co/SicariusSicariiStuff/Phi-lthy4](https://huggingface.co/SicariusSicariiStuff/Phi-lthy4) ) has been consistently described as **exceptionally unique** by all who have tested it, **almost devoid of SLOP**, and it is now widely regarded as the **most unique roleplay model available**. It underwent an intensive continued pretraining (CPT) phase, extensive supervised fine-tuning (SFT) on high-quality organic datasets, and leveraged advanced techniques including model merging, parameter pruning, and upscaling.\\n\\nInterestingly, this distinctiveness was validated in a recent paper: [*Gradient-Based Model Fingerprinting for LLM Similarity Detection and Family Classification*](https://arxiv.org/html/2506.01631v1). Among a wide array of models tested, this one stood out as **unclassifiable** by traditional architecture-based fingerprinting—highlighting the extent of ...   \n",
       "12                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  China's Rednote Open-source dots.llm performance & cost\\n\\n\\nhttps://github.com/rednote-hilab/dots.llm1/blob/main/dots1_tech_report.pdf   \n",
       "\n",
       "         eas  tot_weight  \n",
       "23  0.000000   23.823146  \n",
       "36  0.000000   22.075726  \n",
       "17  0.000000   17.520515  \n",
       "13  0.211321   27.502412  \n",
       "12  0.000000   15.465402  "
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "thread_top_neg[['title', 'eas', 'tot_weight']]"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:reddit_streamlit]",
   "language": "python",
   "name": "conda-env-reddit_streamlit-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}