Alberto Carmona commited on
Commit
f90a30f
·
1 Parent(s): 905f7db

Load the model and the tokenizer

Browse files
Files changed (1) hide show
  1. functions.py +1 -4
functions.py CHANGED
@@ -22,9 +22,6 @@ def extract_text(url: str):
22
 
23
 
24
  def summarize_text(text: str):
25
- # Pending to load the model first
26
- return ''
27
-
28
  print(['summarize_text', 'start'])
29
  input_text = f'<s>Instruction: Elabora un resume del siguiente texto.\nInput: {text}\nOutput: '
30
  batch = tokenizer(input_text, return_tensors='pt')
@@ -53,4 +50,4 @@ def load_model(peft_model_id):
53
  return model, tokenizer
54
 
55
 
56
- # model, tokenizer = load_model("hackathon-somos-nlp-2023/opt-6.7b-lora-sag-t3000-v300-v2")
 
22
 
23
 
24
  def summarize_text(text: str):
 
 
 
25
  print(['summarize_text', 'start'])
26
  input_text = f'<s>Instruction: Elabora un resume del siguiente texto.\nInput: {text}\nOutput: '
27
  batch = tokenizer(input_text, return_tensors='pt')
 
50
  return model, tokenizer
51
 
52
 
53
+ model, tokenizer = load_model("hackathon-somos-nlp-2023/opt-6.7b-lora-sag-t3000-v300-v2")