Text Generation
Transformers
PyTorch
English
Arabic
mixtral
medical
conversational
text-generation-inference
Instructions to use BiMediX/BiMediX-Bi with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BiMediX/BiMediX-Bi with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BiMediX/BiMediX-Bi") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("BiMediX/BiMediX-Bi") model = AutoModelForCausalLM.from_pretrained("BiMediX/BiMediX-Bi") 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 Settings
- vLLM
How to use BiMediX/BiMediX-Bi with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BiMediX/BiMediX-Bi" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BiMediX/BiMediX-Bi", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/BiMediX/BiMediX-Bi
- SGLang
How to use BiMediX/BiMediX-Bi 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 "BiMediX/BiMediX-Bi" \ --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": "BiMediX/BiMediX-Bi", "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 "BiMediX/BiMediX-Bi" \ --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": "BiMediX/BiMediX-Bi", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use BiMediX/BiMediX-Bi with Docker Model Runner:
docker model run hf.co/BiMediX/BiMediX-Bi
Upload files
Browse files
pytorch_model-00011-of-00019.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a635716855d8aa972526333aa32b00618f36edad50e797f793ddaab827321691
|
| 3 |
+
size 4983016700
|
pytorch_model-00012-of-00019.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:828d358f058c95a3ab8ee96d8a689136b90095c2066b6684de9244964041b8b9
|
| 3 |
+
size 4983016700
|
pytorch_model-00013-of-00019.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fb610d40e391928cf9278d0b7d444770c7953db2b08544df53d8ec754b020de3
|
| 3 |
+
size 4983016676
|
pytorch_model-00014-of-00019.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e61bd5453685b3410500e360ce5de691a6b7ee6e6cf41c6528f424e7d8a0692b
|
| 3 |
+
size 4899046246
|
pytorch_model-00015-of-00019.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:762687faff8d43ae482dab2bcc2f645921bfe5ec0b99c7bf81424649e292043e
|
| 3 |
+
size 4983016736
|