How to use from
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 "docto/Docto-Bot" \
    --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": "docto/Docto-Bot",
		"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 "docto/Docto-Bot" \
        --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": "docto/Docto-Bot",
		"prompt": "Once upon a time,",
		"max_tokens": 512,
		"temperature": 0.5
	}'
Quick Links

Docto Bot

Usage (HuggingFace Transformers)

pip install -U transformers
import random
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("docto/Docto-Bot")
model = AutoModelForCausalLM.from_pretrained("docto/Docto-Bot")
special_token = '<|endoftext|>'

prompt_text = 'Question: I am having fever\nAnswer:'
#prompt_text = f'Question: {userinput}\nAnswer:'
encoded_prompt = tokenizer.encode(prompt_text,
                                  add_special_tokens = False,
                                  return_tensors = 'pt')
output_sequences = model.generate(
    input_ids = encoded_prompt,
    max_length = 700,
    temperature = 0.9,
    top_k = 20,
    top_p = 0.9,
    repetition_penalty = 1,
    do_sample = True,
    num_return_sequences = 4
)
result = tokenizer.decode(random.choice(output_sequences))
result = result[result.index("Answer: "):result.index(special_token)]
print(result[8:])

Training Data

The Docto-Bot was trained on Medical Question/Answer dataset

Downloads last month
10
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Space using docto/Docto-Bot 1