Instructions to use riad-hf/riad-disease-gpt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use riad-hf/riad-disease-gpt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="riad-hf/riad-disease-gpt")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("riad-hf/riad-disease-gpt", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use riad-hf/riad-disease-gpt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "riad-hf/riad-disease-gpt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "riad-hf/riad-disease-gpt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/riad-hf/riad-disease-gpt
- SGLang
How to use riad-hf/riad-disease-gpt with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "riad-hf/riad-disease-gpt" \ --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": "riad-hf/riad-disease-gpt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
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 "riad-hf/riad-disease-gpt" \ --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": "riad-hf/riad-disease-gpt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use riad-hf/riad-disease-gpt with Docker Model Runner:
docker model run hf.co/riad-hf/riad-disease-gpt
Riad Disease Gpt
A lightweight medical question-answering model trained on disease-related queries.
Model Details
- Type: Custom GPT-style Transformer
- Language: English
- Parameters: ~5M
- Architecture: 6-layer Transformer with 8 attention heads
- Vocab Size: 2500 (SentencePiece)
- Context Length: 512 tokens
Usage
from transformers import AutoModel, AutoTokenizer
import sentencepiece as spm
# Load model
model = AutoModel.from_pretrained("riadrayhan111/riad-disease-gpt", trust_remote_code=True)
tokenizer = spm.SentencePieceProcessor()
tokenizer.load('riadrayhan111/riad-disease-gpt/tokenizer.model')
# Generate response
class SimpleTokenizer:
def __init__(self, sp_model):
self.sp = sp_model
self.eos_token_id = 2
def encode(self, text):
return self.sp.encode(text)
def decode(self, tokens):
return self.sp.decode(tokens)
tok = SimpleTokenizer(tokenizer)
answer = model.generate_text(tok, "What is fever?", max_length=100)
print(answer)
Training
Trained on a custom medical dataset focused on common diseases, symptoms, and treatments.
Limitations
โ ๏ธ Important: This model is for educational purposes only.
- Not a substitute for professional medical advice
- Limited to information in training data
- Should not be used for medical diagnosis
License
Apache 2.0
- Downloads last month
- 7