Spaces:
Running
Running
Add application file
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import torch
|
|
2 |
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
|
3 |
import gradio as gr
|
4 |
from peft import PeftModel
|
|
|
5 |
|
6 |
# Define the base model ID
|
7 |
base_model_id = "meta-llama/Llama-2-13b-hf"
|
@@ -34,6 +35,7 @@ def formatting_func(job_description):
|
|
34 |
text = f"### The job description: {job_description}\n ### The skills: "
|
35 |
return text
|
36 |
|
|
|
37 |
def generate_skills(job_description):
|
38 |
formatted_text = formatting_func(job_description)
|
39 |
model_input = tokenizer(formatted_text, return_tensors="pt").to("cuda")
|
|
|
2 |
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
|
3 |
import gradio as gr
|
4 |
from peft import PeftModel
|
5 |
+
import spaces
|
6 |
|
7 |
# Define the base model ID
|
8 |
base_model_id = "meta-llama/Llama-2-13b-hf"
|
|
|
35 |
text = f"### The job description: {job_description}\n ### The skills: "
|
36 |
return text
|
37 |
|
38 |
+
@spaces.GPU
|
39 |
def generate_skills(job_description):
|
40 |
formatted_text = formatting_func(job_description)
|
41 |
model_input = tokenizer(formatted_text, return_tensors="pt").to("cuda")
|