Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,31 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 7 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
|
| 4 |
+
# Load your text-generation model from HF
|
| 5 |
+
# (change "YourUsername/YourModel" to whichever model you want to use)
|
| 6 |
+
generator = pipeline("text-generation", model="YourUsername/DeepSeek-R1")
|
| 7 |
+
|
| 8 |
+
def generate_cv(name, education, experience):
|
| 9 |
+
# Build a "prompt" for your model
|
| 10 |
+
prompt = (
|
| 11 |
+
f"Generate a CV based on these details:\n"
|
| 12 |
+
f"Name: {name}\n"
|
| 13 |
+
f"Education: {education}\n"
|
| 14 |
+
f"Experience: {experience}\n"
|
| 15 |
+
"CV:\n"
|
| 16 |
+
)
|
| 17 |
+
|
| 18 |
+
# Call the pipeline to generate text (you can tweak max_length, etc.)
|
| 19 |
+
outputs = generator(prompt, max_length=300)
|
| 20 |
+
cv_text = outputs[0]["generated_text"]
|
| 21 |
+
return cv_text
|
| 22 |
+
|
| 23 |
+
# Create a Gradio interface with 3 textboxes as input
|
| 24 |
+
demo = gr.Interface(
|
| 25 |
+
fn=generate_cv,
|
| 26 |
+
inputs=["text", "text", "text"], # or gr.Textbox(…), etc.
|
| 27 |
+
outputs="text",
|
| 28 |
+
title="Automated CV Generator"
|
| 29 |
+
)
|
| 30 |
|
|
|
|
| 31 |
demo.launch()
|