King-8's picture
Update app.py
88093c0 verified
import gradio as gr
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
model_name = "King-8/confidence-feedback" # Replace with your actual path if needed
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
generator = pipeline("text2text-generation", model=model, tokenizer=tokenizer)
def generate_feedback(prompt):
result = generator(prompt, max_length=50, do_sample=False)[0]["generated_text"]
return result
examples = [
"I don't think I can do this.",
"I'm proud of what I accomplished.",
"I believe I'm ready for the challenge.",
]
description = """
## Confidence Feedback Generator ✨
Enter a statement β€” confident or not β€” and the model will give supportive, personalized feedback.
Try examples like:
- β€œI always doubt myself.”
- β€œI'm proud of how I handled that.”
- β€œI feel nervous before presenting.”
"""
iface = gr.Interface(
fn=generate_feedback,
inputs=gr.Textbox(lines=2, placeholder="Enter your statement here..."),
outputs="text",
examples=examples,
title="Confidence Feedback Generator",
description=description
)
iface.launch()