Skip to content

Instantly share code, notes, and snippets.

View maziyarpanahi's full-sized avatar
⚕️
Healthcare AI

Maziyar Panahi maziyarpanahi

⚕️
Healthcare AI
View GitHub Profile
BOUNDING_BOX_TOOL_NAME = "capture_bounding_boxes"
BOUNDING_BOX_TOOL = {
"type": "function",
"name": BOUNDING_BOX_TOOL_NAME,
"strict": True,
"description": (
"Capture normalized bounding boxes for salient regions in the provided image. "
"Each box should map to a meaningful real-world entity or text block and use clockwise point order."
),
"parameters": {
以下是该处方笺的自然阅读内容,已根据手写体进行识别和整理:
---
**处方笺**
**日期:** 14.6.6号
**姓名:** [已涂黑]
**性别:** 女
**年龄:** 24

Fictional Patient History – Oncology Case Study
(All names, dates, and details are fabricated for educational and platform‑testing purposes. This is not real patient data and does not constitute medical advice.)


1. Identifying Information

Item Details
Patient ID ONC‑2025‑0187
@maziyarpanahi
maziyarpanahi / mistral-small-3-24b.md
Created February 4, 2025 12:56
Mistral Small 3 24B Instruct Leaderboard
Groups Version Filter n-shot Metric Value Stderr
leaderboard N/A none 0 acc 0.4464 ± 0.0045
none 0 acc_norm 0.5778 ± 0.0051
none 0 exact_match 0.1992 ± 0.0055
none 0 inst_level_loose_acc 0.8297 ± N/A
none 0 inst_level_strict_acc 0.8058 ± N/A
none 0 prompt_level_loose_acc 0.7671 ± 0.0182
none 0 prompt_level_strict_acc 0.7338 ± 0.0190
- leaderboard_bbh N/A none 3 acc_norm 0.6454 ± 0.0057
Mapping citations
First, I’m identifying each citation within the text, matching them to the Documents section. This involves noting the citation format and ensuring relevancy to the sentence it supports.
Cross-checking citations
I’m piecing together how the RESPONSE references documents like “According to Document 3” and “Document 9 highlights the importance of psychological flexibility” to ensure the citations accurately reflect the content in the DOCUMENTS.
Verifying citations
Interestingly enough, I’m checking the accuracy of each citation in the RESPONSE by cross-referencing them with the REFERENCES section. This guarantees precise alignment with the document.
Verifying citations
The assistant is instructed to scrutinize citations in the RESPONSE for relevance, cross-reference them with the REFERENCES section, and confirm their accuracy.
ACTIONS NEEDED:
I will read the RESPONSE paragraph by paragraph, assessing citations for appropriateness. Summarizing content may be necessary due to length.
base_model: /workspace/models/Mistral-Nemo-Base-2407
model_type: AutoModelForCausalLM
tokenizer_type: AutoTokenizer
load_in_8bit: false
# load_in_4bit: true
strict: false
datasets:
- path: /workspace/datasets/dolphin-2.9.3/dolphin201-sharegpt2.jsonl
File "/root/miniconda3/envs/py3.10/lib/python3.10/site-packages/trl/trainer/utils.py", line 338, in __call__
to_pad = [torch.LongTensor(ex[k]) for ex in features]
File "/root/miniconda3/envs/py3.10/lib/python3.10/site-packages/trl/trainer/utils.py", line 338, in <listcomp>
to_pad = [torch.LongTensor(ex[k]) for ex in features]
File "/root/miniconda3/envs/py3.10/lib/python3.10/site-packages/trl/trainer/utils.py", line 338, in <listcomp>
to_pad = [torch.LongTensor(ex[k]) for ex in features]
TypeError: 'NoneType' object cannot be interpreted as an integer
to_pad = [torch.LongTensor(ex[k]) for ex in features]
TypeError: 'NoneType' object cannot be interpreted as an integer
return inner_training_loop(

Let's checkout the PR:

git fetch origin pull/625/head:dbrx
git switch dbrx
pip install -vvv --no-build-isolation -e .

Download the model:

@maziyarpanahi
maziyarpanahi / miqu-upload-hf.py
Created February 9, 2024 22:54 — forked from 152334H/miqu-upload-hf.py
upload miqu ckpt to hf
from transformers import LlamaConfig as LC, LlamaForCausalLM as LLM, LlamaTokenizer as LT
from accelerate import init_empty_weights, load_checkpoint_and_dispatch
import torch
lt = LT.from_pretrained("NousResearch/Llama-2-7b-hf")
c = LC.from_pretrained("NousResearch/Llama-2-70b-hf")
c.max_position_embeddings = 32764
c.rope_theta = 1000000
with init_empty_weights(): m = LLM(c)
m = m.half().eval()
m.requires_grad_(False)
@maziyarpanahi
maziyarpanahi / gguf-merge.sh
Created February 2, 2024 08:30 — forked from crasm/gguf-merge.sh
Shell script for merging TheBloke's .gguf-split model files
#!/bin/sh
log() {
format="$1"; shift
# shellcheck disable=SC2059
>&2 printf "$format\n" "$@"
}
usage() {
>&2 cat <<EOF