Instructions to use drmasad/HAH-2024-v0.11 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use drmasad/HAH-2024-v0.11 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="drmasad/HAH-2024-v0.11") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("drmasad/HAH-2024-v0.11") model = AutoModelForCausalLM.from_pretrained("drmasad/HAH-2024-v0.11", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use drmasad/HAH-2024-v0.11 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "drmasad/HAH-2024-v0.11" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "drmasad/HAH-2024-v0.11", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/drmasad/HAH-2024-v0.11
- SGLang
How to use drmasad/HAH-2024-v0.11 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 "drmasad/HAH-2024-v0.11" \ --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": "drmasad/HAH-2024-v0.11", "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 "drmasad/HAH-2024-v0.11" \ --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": "drmasad/HAH-2024-v0.11", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use drmasad/HAH-2024-v0.11 with Docker Model Runner:
docker model run hf.co/drmasad/HAH-2024-v0.11
Model Card for HAH 2024 v0.1
This modelcard aims to be a base template for new models. It has been generated using this raw template.
Model Details
Model Description
HAH 2024 v0.11 aim is to ASSESS how an advanced language model fine-tuned for generating insights from diabetes-related healthcare data will perform. HAH 2024 v0.1 is intended to for research purposes only.
- Developed by: Dr M As'ad
- Funded by: Self funded
- Model type: Transformer-based language model
- Language(s) (NLP): English
- License: Apache-2.0
- Finetuned from model [optional]: Mistral 7b Instruct v0.2
Uses
Direct Use
HAH 2024 v0.11 is designed to assess the performance for direct use in chat interface on diabetes domain.
Downstream Use [optional]
The model can also be fine-tuned for specialized tasks sch a subtypes or subgroups in diabetes field.
Out-of-Scope Use
This model is not recommended for non-English text or contexts outside of healthcare, IT is research project not for any deployments to be used in real chat interface.
Bias, Risks, and Limitations
The model may inherently carry biases from the training data related to diabetes literature, potentially reflecting the geographic and demographic focus of the sources.
Recommendations
Users should verify the model-generated information with current medical guidelines and consider a manual review for sensitive applications.
How to Get Started with the Model
Use the code below to get started with the model:
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
# Assuming the model and tokenizer are loaded with 'username/HAH_2024_v0.1'
model = AutoModelForCausalLM.from_pretrained("drmasad/HAH_2024_v0.11")
tokenizer = AutoTokenizer.from_pretrained("drmasad/HAH_2024_v0.11")
# Setting up the instruction and the user prompt
instructions = "you are an expert endocrinologist. Answer the query in accurate informative language any patient will understand."
user_prompt = "what is diabetic retinopathy?"
# Using the pipeline for text-generation
pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=200)
# Formatting the input with special tokens [INST] and [/INST] for instructions
result = pipe(f"<s>[INST] {instructions} [/INST] {user_prompt}</s>")
# Extracting generated text and post-processing
generated_text = result[0]['generated_text']
# Split the generated text to get the text after the last occurrence of </s>
answer = generated_text.split("</s>")[-1].strip()
# Print the answer
print(answer)
- Downloads last month
- -
Space using drmasad/HAH-2024-v0.11 1
Evaluation results
- Placeholder Metric for Development on Custom Dataset (3000 review articles on diabetes)self-reported0.000