wangzerui commited on
Commit
b40c9fc
·
1 Parent(s): 6eb2110

Add application file

Browse files
Files changed (1) hide show
  1. app.py +2 -0
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")