Instructions to use Mohammed-Altaf/Medical-ChatBot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Mohammed-Altaf/Medical-ChatBot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Mohammed-Altaf/Medical-ChatBot")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Mohammed-Altaf/Medical-ChatBot") model = AutoModelForCausalLM.from_pretrained("Mohammed-Altaf/Medical-ChatBot") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Mohammed-Altaf/Medical-ChatBot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Mohammed-Altaf/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": "Mohammed-Altaf/Medical-ChatBot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Mohammed-Altaf/Medical-ChatBot
- SGLang
How to use Mohammed-Altaf/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 "Mohammed-Altaf/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": "Mohammed-Altaf/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 "Mohammed-Altaf/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": "Mohammed-Altaf/Medical-ChatBot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Mohammed-Altaf/Medical-ChatBot with Docker Model Runner:
docker model run hf.co/Mohammed-Altaf/Medical-ChatBot
MetwalyChatBot
Browse files
README.md
CHANGED
|
@@ -27,7 +27,7 @@ prompt_input = (
|
|
| 27 |
"[|Human|] {input}\n"
|
| 28 |
"[|AI|]"
|
| 29 |
)
|
| 30 |
-
sentence = prompt_input.format_map({'input': "what is
|
| 31 |
inputs = tokenizer(sentence, return_tensors="pt").to(device)
|
| 32 |
|
| 33 |
with torch.no_grad():
|
|
@@ -45,12 +45,14 @@ with torch.no_grad():
|
|
| 45 |
## Example Outputs
|
| 46 |
```
|
| 47 |
The conversation between human and AI assistant.
|
| 48 |
-
[|Human|] what is
|
| 49 |
-
[|AI|]
|
| 50 |
```
|
| 51 |
|
| 52 |
```
|
| 53 |
The conversation between human and AI assistant.
|
| 54 |
-
[|Human|]
|
| 55 |
-
[|AI|]
|
|
|
|
|
|
|
| 56 |
```
|
|
|
|
| 27 |
"[|Human|] {input}\n"
|
| 28 |
"[|AI|]"
|
| 29 |
)
|
| 30 |
+
sentence = prompt_input.format_map({'input': "what is Autism's disease?"})
|
| 31 |
inputs = tokenizer(sentence, return_tensors="pt").to(device)
|
| 32 |
|
| 33 |
with torch.no_grad():
|
|
|
|
| 45 |
## Example Outputs
|
| 46 |
```
|
| 47 |
The conversation between human and AI assistant.
|
| 48 |
+
[|Human|] what is Autism's disease?
|
| 49 |
+
[|AI|] Autism's disease, also known as Autism Spectrum Disorder (ASD), is a neurodevelopmental disorder that affects communication, social interaction, and behavior.
|
| 50 |
```
|
| 51 |
|
| 52 |
```
|
| 53 |
The conversation between human and AI assistant.
|
| 54 |
+
[|Human|] What are the side effects of autism?
|
| 55 |
+
[|AI|] Autism is a neurodevelopmental disorder that affects communication, social interaction, and behavior. Some common side effects of autism include difficulty with speech and language, repetitive behaviors or routines, and sensory sensitivities.
|
| 56 |
+
|
| 57 |
+
|
| 58 |
```
|