Huatuo G P T o1 72 B
FreedomIntelligenceIntroduction
HuatuoGPT-o1-72B is a large language model (LLM) specialized in medical reasoning. It is designed to engage in complex thought processes, allowing it to reflect and refine its reasoning before delivering a final response. This model supports both English and Chinese languages and is part of a series that includes various versions with different capabilities. More details can be found in its GitHub repository here.
Architecture
HuatuoGPT-o1-72B utilizes the Qwen2.5-72B model as its backbone. It is capable of generating text through a unique "thinks-before-it-answers" approach, where it first outlines its reasoning process before providing a final response. This structured output format enhances its ability to perform complex medical reasoning tasks.
Training
The model has been trained using datasets focused on medical reasoning and verifiable problem-solving, specifically:
- FreedomIntelligence/medical-o1-reasoning-SFT
- FreedomIntelligence/medical-o1-verifiable-problem
These datasets help the model to develop the capacity for advanced medical reasoning.
Guide: Running Locally
To use HuatuoGPT-o1-72B locally, follow these steps:
- Environment Setup: Ensure you have Python and PyTorch installed. Set up a virtual environment if needed.
- Install Transformers: Use the command
pip install transformers
to install Hugging Face's Transformers library. - Load the Model and Tokenizer:
from transformers import AutoModelForCausalLM, AutoTokenizer model = AutoModelForCausalLM.from_pretrained("FreedomIntelligence/HuatuoGPT-o1-72B", torch_dtype="auto", device_map="auto") tokenizer = AutoTokenizer.from_pretrained("FreedomIntelligence/HuatuoGPT-o1-72B")
- Generate Text:
input_text = "How to stop a cough?" messages = [{"role": "user", "content": input_text}] inputs = tokenizer(tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True), return_tensors="pt").to(model.device) outputs = model.generate(**inputs, max_new_tokens=2048) print(tokenizer.decode(outputs[0], skip_special_tokens=True))
For optimal performance, consider using cloud GPU services such as AWS, Google Cloud, or Azure, which provide the required computational resources.
License
HuatuoGPT-o1-72B is released under the Apache 2.0 License. This allows for both personal and commercial use, with the condition that proper attribution is given, and any modifications are also shared under the same license.