FastAPI / app.py
sekuxrious's picture
Update app.py
e2bc3f2 verified
raw
history blame
933 Bytes
import gradio as gr
from transformers import pipeline
# Load your text-generation model from HF
# (change "YourUsername/YourModel" to whichever model you want to use)
generator = pipeline("text-generation", model="YourUsername/DeepSeek-R1")
def generate_cv(name, education, experience):
# Build a "prompt" for your model
prompt = (
f"Generate a CV based on these details:\n"
f"Name: {name}\n"
f"Education: {education}\n"
f"Experience: {experience}\n"
"CV:\n"
)
# Call the pipeline to generate text (you can tweak max_length, etc.)
outputs = generator(prompt, max_length=300)
cv_text = outputs[0]["generated_text"]
return cv_text
# Create a Gradio interface with 3 textboxes as input
demo = gr.Interface(
fn=generate_cv,
inputs=["text", "text", "text"], # or gr.Textbox(…), etc.
outputs="text",
title="Automated CV Generator"
)
demo.launch()