Spaces:
Sleeping
Sleeping
File size: 933 Bytes
2e79ccc e2bc3f2 2e79ccc e2bc3f2 2e79ccc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 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() |