Spaces:
Sleeping
Sleeping
Testing
Browse files12345678910111213from transformers import pipeline# Load the fine-tuned model from Hugging Facegenerator = pipeline("text2text-generation", model="DetectiveShadow/inspiration-message-generator")# Define test promptprompt = "Age: 32 | Profession: Engineer | Archetype: Innovator"# Run modelresult = generator(prompt, max_new_tokens=100)[0]["generated_text"]# Print outputprint(result)1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253import gradio as grdef readiness_predictor(savings, income, bills, entertainment, sales_skills, dependents, assets, age):# Simple heuristic formula for "entrepreneurial readiness"disposable_income = income - bills - entertainmentscore = ((savings + assets) / 1000+ disposable_income / 500+ sales_skills * 2- dependents+ (40 - abs(35 - age)) / 5)score = max(0, min(100, score)) # clamp between 0 and 100if score < 30:prediction = "Low readiness"elif score < 60:prediction = "Moderate readiness"else:prediction = "High readiness"return {"Readiness Score": round(score, 2),"Prediction": prediction}with gr.Blocks() as demo:gr.Markdown("# Entrepreneurial Readiness Predictor")with gr.Row():with gr.Column():savings = gr.Number(label="Savings Amount ($)", value=1000)income = gr.Number(label="Monthly Income ($)", value=4000)bills = gr.Number(label="Monthly Bills ($)", value=2500)entertainment = gr.Number(label="Monthly Entertainment ($)", value=300)sales_skills = gr.Slider(label="Sales Skills (1–5)", minimum=1, maximum=5, step=1, value=3)dependents = gr.Slider(label="Dependents (0–6)", minimum=0, maximum=6, step=1, value=1)assets = gr.Number(label="Assets ($)", value=8000)age = gr.Number(label="Age", value=28)with gr.Column():output = gr.JSON(label="Prediction")btn = gr.Button("Predict")btn.click(readiness_predictor,inputs=[savings, income, bills, entertainment, sales_skills, dependents, assets, age],outputs=output)demo.launch()
app.py+49-9