Huatuo G P T o1 8 B

FreedomIntelligence

Introduction

HuatuoGPT-o1 is a medical language model (LLM) designed for advanced medical reasoning. It simulates a complex thought process by reflecting and refining its reasoning before providing a final response. This approach is intended to enhance its ability to generate accurate and reliable medical information.

Architecture

The architecture of HuatuoGPT-o1 is based on the LLaMA-3.1-8B model, supporting English language capabilities. Other variants in the series include models with different sizes and additional language support, such as English and Chinese. The model is part of the text-generation pipeline and is specifically fine-tuned for medical applications.

Training

HuatuoGPT-o1 is trained using datasets focused on medical reasoning and verifiable problems, including:

  • FreedomIntelligence/medical-o1-reasoning-SFT
  • FreedomIntelligence/medical-o1-verifiable-problem

The model also incorporates a "thinks-before-it-answers" methodology, where the output includes a reasoning process followed by a final response.

Guide: Running Locally

To run HuatuoGPT-o1 locally, you can use the following Python code snippet:

from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("FreedomIntelligence/HuatuoGPT-o1-8B", torch_dtype="auto", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("FreedomIntelligence/HuatuoGPT-o1-8B")

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))

Cloud GPUs

For optimal performance, especially with larger models, consider using cloud GPU services such as AWS, Google Cloud, or Azure which offer scalable GPU resources.

License

HuatuoGPT-o1 is licensed under the Apache-2.0 License, allowing for extensive use and modification while maintaining certain conditions. For more details, refer to the official license documentation.

More Related APIs in Text Generation