lavita/medical-qa-datasets
Viewer • Updated • 1.69M • 2.52k • 57
How to use OussamaEL/medical-llm-10m-base with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="OussamaEL/medical-llm-10m-base") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("OussamaEL/medical-llm-10m-base")
model = AutoModelForCausalLM.from_pretrained("OussamaEL/medical-llm-10m-base")How to use OussamaEL/medical-llm-10m-base with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "OussamaEL/medical-llm-10m-base"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "OussamaEL/medical-llm-10m-base",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/OussamaEL/medical-llm-10m-base
How to use OussamaEL/medical-llm-10m-base with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "OussamaEL/medical-llm-10m-base" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "OussamaEL/medical-llm-10m-base",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "OussamaEL/medical-llm-10m-base" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "OussamaEL/medical-llm-10m-base",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use OussamaEL/medical-llm-10m-base with Docker Model Runner:
docker model run hf.co/OussamaEL/medical-llm-10m-base
This is a 10 million parameter GPT-2 style language model specifically trained for medical dialogue generation. The model is designed as a base model for fine-tuning on specialized medical tasks, particularly sensor interpretation for ESP32 edge deployment.
GPT2Config(
vocab_size=8192,
n_positions=512,
n_embd=256,
n_layer=10,
n_head=8,
n_inner=1024
)
from transformers import GPT2LMHeadModel, GPT2Config
import torch
# Load configuration
config = GPT2Config.from_pretrained("OussamaEL/medical-llm-10m-base")
# Load model
model = GPT2LMHeadModel.from_pretrained("OussamaEL/medical-llm-10m-base")
# For ESP32 sensor interpretation fine-tuning
# Use the provided fine-tuning scripts with sensor datasets
# Input format for sensor interpretation:
# "<bos>Sensors: Temp 38.5°C, HR 95 bpm, SpO2 96% ||| Assessment: [response]<eos>"
# Expected output:
# "Elevated temperature with normal heart rate. Possible mild infection."
If you use this model, please cite:
@model{medical_llm_10m,
title={Medical LLM Base Model for ESP32 Deployment},
author={Your Name},
year={2024},
url={https://huggingface.co/OussamaEL/medical-llm-10m-base}
}
MIT License - See LICENSE file for details.