Text Generation
Transformers
Safetensors
qwen3_5
image-text-to-text
medical
healthcare
qwen
conversational
Instructions to use danosethrus/EthioDoc with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use danosethrus/EthioDoc with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="danosethrus/EthioDoc") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("danosethrus/EthioDoc") model = AutoModelForMultimodalLM.from_pretrained("danosethrus/EthioDoc", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use danosethrus/EthioDoc with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "danosethrus/EthioDoc" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "danosethrus/EthioDoc", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/danosethrus/EthioDoc
- SGLang
How to use danosethrus/EthioDoc 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 "danosethrus/EthioDoc" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "danosethrus/EthioDoc", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "danosethrus/EthioDoc" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "danosethrus/EthioDoc", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use danosethrus/EthioDoc with Docker Model Runner:
docker model run hf.co/danosethrus/EthioDoc
File size: 3,421 Bytes
240b3c8 | 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 | <!DOCTYPE html>
<html>
<head>
<title>EthioDocs Medical AI</title>
<style>
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; max-width: 800px; margin: 40px auto; padding: 20px; background-color: #f0f2f5; }
.container { background: white; padding: 30px; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
h1 { color: #2c3e50; border-bottom: 2px solid #3498db; padding-bottom: 10px; }
#input { width: 100%; height: 120px; padding: 15px; border: 2px solid #ddd; border-radius: 10px; font-size: 16px; margin: 15px 0; box-sizing: border-box; }
#status { color: #7f8c8d; font-style: italic; margin-bottom: 10px; }
button { background: #3498db; color: white; border: none; padding: 12px 25px; cursor: pointer; border-radius: 8px; font-weight: bold; transition: 0.3s; }
button:hover { background: #2980b9; }
button:disabled { background: #bdc3c7; cursor: not-allowed; }
#result { background: #ecf0f1; padding: 20px; border-radius: 10px; margin-top: 20px; white-space: pre-wrap; color: #2c3e50; border-left: 6px solid #3498db; }
</style>
</head>
<body>
<div class="container">
<h1>🏥 EthioDocs Medical Assistant</h1>
<p>A Grade 10 AI Project by Daniel (WebGPU Powered)</p>
<div id="status">Status: Waiting to initialize...</div>
<button id="init-btn">Start Medical Engine</button>
<hr>
<textarea id="input" placeholder="Example: I have a persistent cough and a fever of 38°C. What should I do?"></textarea>
<button id="send-btn" disabled>Get Medical Advice</button>
<div id="result">The diagnosis will appear here after initialization.</div>
</div>
<script type="module">
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.0.0';
let generator;
const status = document.getElementById('status');
const initBtn = document.getElementById('init-btn');
const sendBtn = document.getElementById('send-btn');
initBtn.onclick = async () => {
initBtn.disabled = true;
status.innerText = "Status: Downloading Model (4.5GB)... This may take 2-5 minutes.";
try {
// CALLING YOUR SPECIFIC MODEL
generator = await pipeline('text-generation', 'danosethrus/Medical-Qwen-2B-Ethiopia', {
device: 'webgpu',
});
status.innerText = "Status: ✅ Ready! Model running on your local GPU.";
sendBtn.disabled = false;
} catch (err) {
status.innerText = "Status: ❌ Error. Make sure you're using Chrome/Edge and have WebGPU enabled.";
console.error(err);
}
};
sendBtn.onclick = async () => {
const text = document.getElementById('input').value;
if(!text) return;
status.innerText = "Status: AI is diagnosing...";
const output = await generator(text, {
max_new_tokens: 256,
temperature: 0.7,
do_sample: true
});
document.getElementById('result').innerText = output[0].generated_text;
status.innerText = "Status: ✅ Ready.";
};
</script>
</body>
</html> |