Instructions to use DHEIVER/Medical-ChatBot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DHEIVER/Medical-ChatBot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DHEIVER/Medical-ChatBot")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("DHEIVER/Medical-ChatBot") model = AutoModelForCausalLM.from_pretrained("DHEIVER/Medical-ChatBot") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use DHEIVER/Medical-ChatBot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DHEIVER/Medical-ChatBot" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DHEIVER/Medical-ChatBot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/DHEIVER/Medical-ChatBot
- SGLang
How to use DHEIVER/Medical-ChatBot 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 "DHEIVER/Medical-ChatBot" \ --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": "DHEIVER/Medical-ChatBot", "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 "DHEIVER/Medical-ChatBot" \ --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": "DHEIVER/Medical-ChatBot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use DHEIVER/Medical-ChatBot with Docker Model Runner:
docker model run hf.co/DHEIVER/Medical-ChatBot
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Aviso Legal
Este chatbot foi projetado apenas para fins de pesquisa e não se destina ao uso em configurações médicas reais. Embora o chatbot tenha sido treinado para fornecer respostas precisas e úteis, ele não substitui o aconselhamento médico profissional, o diagnóstico ou o tratamento. As informações fornecidas pelo chatbot não devem ser usadas para tomar decisões médicas, e quaisquer preocupações com a saúde devem ser tratadas por um profissional de saúde licenciado.
Início Rápido
import torch
from transformers import GPT2LMHeadModel, GPT2Tokenizer
caminho = "Mohammed-Altaf/Medical-ChatBot"
dispositivo = "cuda" if torch.cuda.is_available() else "cpu"
tokenizer = GPT2Tokenizer.from_pretrained(caminho)
modelo = GPT2LMHeadModel.from_pretrained(caminho).to(dispositivo)
entrada_prompt = (
"A conversa entre humano e assistente de IA.\n"
"[|Humano|] {input}\n"
"[|IA|]"
)
frase = entrada_prompt.format_map({'input': "o que é a doença de Parkinson?"})
inputs = tokenizer(frase, return_tensors="pt").to(dispositivo)
with torch.no_grad():
beam_output = modelo.generate(**inputs,
min_new_tokens=1,
max_length=512,
num_beams=3,
repetition_penalty=1.2,
early_stopping=True,
eos_token_id=198
)
print(tokenizer.decode(beam_output[0], skip_special_tokens=True))
Exemplos de Saída
A conversa entre humano e assistente de IA.
[|Humano|] o que é a doença de Parkinson?
[|IA|] A doença de Parkinson é um distúrbio neurodegenerativo que afeta o movimento. É causada pela perda de células produtoras de dopamina no cérebro.
A conversa entre humano e assistente de IA.
[|Humano|] que tipo de mel é melhor para uma tosse ruim de covid?
[|IA|] O mel de Manuka mostrou ter propriedades anti-inflamatórias e antibacterianas que podem ajudar a aliviar os sintomas de uma tosse ruim de covid.
- Downloads last month
- 5