This model is a fine-tuned version of Qwen/Qwen2-1.5B-Instruct optimized for generating synthetic survey responses across multiple domains. It has been instruction-tuned using a custom dataset of survey responses, with each response reflecting a specific persona.
This model is specifically designed for generating synthetic survey responses from different personas. It works best when provided with:
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained("aryashah00/survey-finetuned-Qwen2-1.5B-Instruct", device_map="auto", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("aryashah00/survey-finetuned-Qwen2-1.5B-Instruct", trust_remote_code=True)
# Define persona and question
persona = "A nurse who educates the child about modern medical treatments and encourages a balanced approach to healthcare"
question = "How often was your pain well controlled during this hospital stay?"
# Prepare prompts
system_prompt = f"You are embodying the following persona: {{persona}}"
user_prompt = f"Survey Question: {{question}}\n\nPlease provide your honest and detailed response to this question."
# Create message format
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_prompt}
]
# Apply chat template
input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
# Tokenize
input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to(model.device)
# Generate response
import torch
with torch.no_grad():
output_ids = model.generate(
input_ids=input_ids,
max_new_tokens=256,
temperature=0.7,
top_p=0.9,
do_sample=True
)
# Decode
output = tokenizer.decode(output_ids[0], skip_special_tokens=True)
# Extract just the generated response
response_start = output.find(input_text) + len(input_text)
generated_response = output[response_start:].strip()
print(f"Generated response: {{generated_response}}")
import requests
API_URL = "https://api-inference.huggingface.co/models/aryashah00/survey-finetuned-Qwen2-1.5B-Instruct"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
messages = [
{"role": "system", "content": "You are embodying the following persona: A nurse who educates the child about modern medical treatments and encourages a balanced approach to healthcare"},
{"role": "user", "content": "Survey Question: How often was your pain well controlled during this hospital stay?\n\nPlease provide your honest and detailed response to this question."}
]
output = query({"inputs": messages})
print(output)
This model follows the license of the base model Qwen/Qwen2-1.5B-Instruct.
model.safetensors 2.2 GBcheckpoint-1700/optimizer.pt 148 MBcheckpoint-1785/optimizer.pt 148 MBcheckpoint-700/optimizer.pt 148 MBadapter_model.safetensors 74 MBcheckpoint-1700/adapter_model.safetensors 74 MBcheckpoint-1785/adapter_model.safetensors 74 MBcheckpoint-700/adapter_model.safetensors 74 MBcheckpoint-1700/rng_state.pth 14.2 kBcheckpoint-1785/rng_state.pth 14.2 kBcheckpoint-700/rng_state.pth 14.2 kBcheckpoint-1700/training_args.bin 5.4 kBcheckpoint-1785/training_args.bin 5.4 kBcheckpoint-700/training_args.bin 5.4 kBtraining_args.bin 5.4 kBcheckpoint-1700/scheduler.pt 1.1 kBcheckpoint-1785/scheduler.pt 1.1 kBcheckpoint-700/scheduler.pt 1.1 kBcheckpoint-1700/scaler.pt 1 kBcheckpoint-1785/scaler.pt 1 kBcheckpoint-700/scaler.pt 1 kBHave the files? Submit a torrent.
Submit a torrentHave the complete files and permission to share them? Replace the example folder path. The script checks the files, makes a torrent and submits its magnet and checksums. Keep your torrent client seeding. Get your community key from your settings, and read the script before running it.
curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo aryashah00/survey-finetuned-Qwen2-1.5B-Instruct ./model-folder