Text Generation
Transformers
PyTorch
English
mixtral
medical
conversational
text-generation-inference
Instructions to use BiMediX/BiMediX-Eng with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BiMediX/BiMediX-Eng with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BiMediX/BiMediX-Eng") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("BiMediX/BiMediX-Eng") model = AutoModelForCausalLM.from_pretrained("BiMediX/BiMediX-Eng", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use BiMediX/BiMediX-Eng with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BiMediX/BiMediX-Eng" # 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-Eng", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/BiMediX/BiMediX-Eng
- SGLang
How to use BiMediX/BiMediX-Eng 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-Eng" \ --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-Eng", "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-Eng" \ --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-Eng", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use BiMediX/BiMediX-Eng with Docker Model Runner:
docker model run hf.co/BiMediX/BiMediX-Eng
Update README.md
Browse files
README.md
CHANGED
|
@@ -57,11 +57,8 @@ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
|
| 57 |
| Meditron-70B | 72.3 | 82.5 | 62.8 | 77.8 | 77.9 | 62.7 | **65.1** | 60.7 | 80.0 | 71.3 |
|
| 58 |
| **BiMediX** | **78.9** | **86.1** | **68.2** | **85.0** | **80.5** | **74.1**| 62.7 | **62.8** | **80.2** | **75.4** |
|
| 59 |
|
| 60 |
-
### Limitations
|
| 61 |
-
- Potential issues: hallucinations, toxicity, stereotypes.
|
| 62 |
-
- Medical diagnoses and recommendations require human evaluation.
|
| 63 |
-
|
| 64 |
### Safety and Ethical Considerations
|
|
|
|
| 65 |
- **Usage:** Research purposes only.
|
| 66 |
|
| 67 |
### Accessibility
|
|
|
|
| 57 |
| Meditron-70B | 72.3 | 82.5 | 62.8 | 77.8 | 77.9 | 62.7 | **65.1** | 60.7 | 80.0 | 71.3 |
|
| 58 |
| **BiMediX** | **78.9** | **86.1** | **68.2** | **85.0** | **80.5** | **74.1**| 62.7 | **62.8** | **80.2** | **75.4** |
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
### Safety and Ethical Considerations
|
| 61 |
+
- **Potential issues**: hallucinations, toxicity, stereotypes.
|
| 62 |
- **Usage:** Research purposes only.
|
| 63 |
|
| 64 |
### Accessibility
|