Instructions to use abhiyanta/chatDoctor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use abhiyanta/chatDoctor with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="abhiyanta/chatDoctor") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("abhiyanta/chatDoctor") model = AutoModelForCausalLM.from_pretrained("abhiyanta/chatDoctor") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use abhiyanta/chatDoctor with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "abhiyanta/chatDoctor" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "abhiyanta/chatDoctor", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/abhiyanta/chatDoctor
- SGLang
How to use abhiyanta/chatDoctor 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 "abhiyanta/chatDoctor" \ --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": "abhiyanta/chatDoctor", "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 "abhiyanta/chatDoctor" \ --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": "abhiyanta/chatDoctor", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use abhiyanta/chatDoctor with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for abhiyanta/chatDoctor to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for abhiyanta/chatDoctor to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for abhiyanta/chatDoctor to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="abhiyanta/chatDoctor", max_seq_length=2048, ) - Docker Model Runner
How to use abhiyanta/chatDoctor with Docker Model Runner:
docker model run hf.co/abhiyanta/chatDoctor
Model Card for Medical Chatbot LLaMA3 8b 4-bit Fine-tuned Model
This is a fine-tuned version of the LLaMA3 model designed to assist with medical queries and preliminary health advice through a chatbot. It uses a 4-bit quantization to reduce memory usage while maintaining efficiency for chatbot interactions.
Model Details
Model Description
This model is a LLaMA3-8b based chatbot fine-tuned specifically for medical symptom analysis and preliminary assessments. It uses 4-bit quantization, which allows for reduced memory usage, making it suitable for deployment on resource-constrained environments. The chatbot can respond to medical inquiries and provide initial health recommendations, though it should not be used as a substitute for professional medical advice. This model is trained on 1M datapoints dataset consisting of Question answering related to Medical field. It would be helpful for both general person who wants info related to medical issues and also for healthcare providers.
- Developed by: Himanshu Kumar
- Finetuned from model: LLaMA3 8b
- Language(s) (NLP): English
- License: apache-2.0
- Model type: Causal Language Model (LLM), Fine-tuned with LoRA and 4-bit quantization
Uses
Direct Use
The model is primarily intended for use in medical chatbots to handle preliminary health-related queries and symptom analysis. It is designed for interactive applications that aim to provide users with health-related information and advice.
Downstream Use
This model can be further fine-tuned or adapted to other medical domains or integrated into larger healthcare-related systems. It can also be used for other conversational AI tasks in the medical domain, such as appointment scheduling, follow-up care reminders, or patient triage systems.
Out-of-Scope Use
- This model should not be used for critical medical decision-making or as a substitute for professional medical advice.
Bias, Risks, and Limitations
The model may inherit biases present in the training data, and the responses should be carefully monitored, particularly in sensitive contexts like healthcare. It is recommended that the model's responses be reviewed by healthcare professionals.
Recommendations
Users should exercise caution and verify any medical information provided by the model with qualified professionals. The model's limitations in handling complex medical cases must be understood before deployment in real-world scenarios.
How to Get Started with the Model
Use the following code to get started with the model:
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("abhiyanta/chatDoctor")
tokenizer = AutoTokenizer.from_pretrained("abhiyanta/chatDoctor")
inputs = tokenizer(
[
alpaca_prompt.format(
"I have fever, what should i do?", # instruction
"", # input
"", # output - leave this blank for generation!
)
], return_tensors = "pt").to("cuda")
from transformers import TextStreamer
text_streamer = TextStreamer(tokenizer)
_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 128)
- Downloads last month
- 9
Model tree for abhiyanta/chatDoctor
Base model
meta-llama/Meta-Llama-3-8B