You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Fine-Tuned ReFT 9B Model

This repository contains a fine-tuned ReFT (Representation Fine-Tuning) model for automating data extraction in medical Systematic Literature Reviews (SLRs).

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

# Define the device
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

# Replace with your actual repo ID
repo_id = "your_username/fine_tuned_reft_9b"

# Load the tokenizer
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)

# Load the model
model = AutoModelForCausalLM.from_pretrained(repo_id, trust_remote_code=True).to(device)

# Example usage
prompt = """
<|im_start|>system
You are a helpful assistant that extracts specific data from medical studies.
<|im_end|>
<|im_start|>user
Please extract specific data from the following study. Focus on the abstract, methodology, and results sections only.

**Instructions:**
- **Only provide the answers to the following five questions.**
- **Format your response as numbered answers from 1 to 5.**
- **Each answer should be concise, focusing only on the information requested.**
- **Do not include any explanations, restatements of the questions, or additional text.**

**Questions:**
1. What is the total number of participants (N) in the study?
2. What is the mean age of the participants?
3. What are the main interventions applied to the intervention and control groups?
4. What are the primary outcomes measured in the study?
5. Were there any participants lost to follow-up, and if so, how many?

**Study Text**:
{study_text}

**Answers:**
<|im_end|>
<|im_start|>assistant
"""

# Replace {study_text} with your actual study text
study_text = "Your study text goes here."

# Encode the input
inputs = tokenizer(prompt.replace("{study_text}", study_text), return_tensors="pt").to(device)

# Generate the response
outputs = model.generate(**inputs, max_length=500)

# Decode and print the response
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support