Text Generation
Transformers
Safetensors
Persian
gemma
neura
medical
DrNeura
text-generation-inference
4-bit precision
bitsandbytes
Instructions to use Neurai/NeuraMedicalGemma7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Neurai/NeuraMedicalGemma7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Neurai/NeuraMedicalGemma7b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Neurai/NeuraMedicalGemma7b") model = AutoModelForCausalLM.from_pretrained("Neurai/NeuraMedicalGemma7b") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Neurai/NeuraMedicalGemma7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Neurai/NeuraMedicalGemma7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Neurai/NeuraMedicalGemma7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Neurai/NeuraMedicalGemma7b
- SGLang
How to use Neurai/NeuraMedicalGemma7b 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 "Neurai/NeuraMedicalGemma7b" \ --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": "Neurai/NeuraMedicalGemma7b", "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 "Neurai/NeuraMedicalGemma7b" \ --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": "Neurai/NeuraMedicalGemma7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Neurai/NeuraMedicalGemma7b with Docker Model Runner:
docker model run hf.co/Neurai/NeuraMedicalGemma7b
Neura Orca Gemma 7B
Model Description
- Developed by: Neura company
- Funded by: Neura
- Model type: gemma7b
- Language(s) (NLP): Persian
- Finetuned from model: google/gemma-7b-it
Model Sources
- Repository: https://huggingface.co/google/gemma-7b-it
Uses
Check out the Google Colab demo to run NeuraOrcaGemma7b on a free-tier Google Colab instance:
make sure these packages are installed:
!pip install --no-deps xformers accelerate bitsandbytes
!pip install -q -U transformers
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
import torch
import os
MODEL_PATH = "Neurai/NeuraMedicalGemma7b"
quantization_config = BitsAndBytesConfig(
load_in_4bit = True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True,
)
model = AutoModelForCausalLM.from_pretrained(
MODEL_PATH,
device_map = "auto",
trust_remote_code = True,
quantization_config=quantization_config,
)
tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
input_prompt = """
### Instruction:{}
### Input:{}
### Response:{}"""
input_text = input_prompt.format(
"انگشت شصت دستم با درد باز میشود عکس ام آر آی هم گرفتم اثری از شکستگی نیست تشخیص تو چیه؟",
"",
""
)
inputs = tokenizer([input_text], return_tensors = "pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens = 300, use_cache = True)
response = tokenizer.batch_decode(outputs)[0]
Generated text :
بر اساس علائم و نتایج تصویربرداری،
به نظر میرسد که شما ممکن است از سندرم تونل کارپال رنج ببرید.
این وضعیت زمانی رخ می دهد که عصب مدیان در مچ دست شما فشرده یا فشرده می شود.
در مورد شما، ممکن است که ضربه به انگشت شست شما باعث این فشردگی شده باشد. <eos>
More Information
Model Card Authors
Esmaeil Zahedi, Mohsen Yazdinejad
Model Card Contact
- Downloads last month
- 9