Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4tokenizer = AutoTokenizer.from_pretrained("{full_repo_name}")
5model = AutoModelForCausalLM.from_pretrained("{full_repo_name}").to("cuda")
6
7question = "How can I identify and manage early signs of sepsis in adults?"
8prompt = f"{{question}}\\nReasoning: <insert reasoning here>\\nAnswer:"
9inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
10outputs = model.generate(**inputs, max_new_tokens=500)
11print(tokenizer.decode(outputs[0], skip_special_tokens=True))
12Training Details
13Training Data: FreedomIntelligence/medical-o1-reasoning-SFT
14
15Training Regime: Fine-tuned on Qwen base model
16
17Hardware: GPU-based
18
19Compute Region: [More Information Needed]
20
21Citation
22java
23Copy code
24@misc{qwen-medical-reasoning,
25 title={Qwen Fine-tuned Medical Reasoning Model},
26 author={Ghost2513},
27 year={2025},
28 howpublished={https://huggingface.co/{full_repo_name}}
29}
30"""
31
32with open("README.md", "w") as f:
33f.write(readme_text)
34
35api.upload_file(
36path_or_fileobj="README.md",
37path_in_repo="README.md",
38repo_id=full_repo_name,
39token=HF_TOKEN
40)
41print("Model and README successfully uploaded to Hugging Face Hub!")
42
43vbnet
44Copy code
45
46This script does the following:
47
481. Logs in to Hugging Face using `HF_TOKEN`.
492. Loads your fine-tuned Qwen model and tokenizer.
503. Creates the repo if it doesn’t exist.
514. Pushes both the model and tokenizer.
525. Generates a **full README/model card** with all sections you provided (most fields are placeholders for you to fill).
536. Uploads the README to the repository.
54
55---