Spaces:
Sleeping
Sleeping
Commit
·
302a390
1
Parent(s):
d7b6a67
test cv extraction
Browse files
app.py
CHANGED
@@ -57,7 +57,7 @@ def read_pdf(file_path):
|
|
57 |
return output
|
58 |
|
59 |
|
60 |
-
@spaces.GPU(duration=
|
61 |
def LLM_Inference(cv_text):
|
62 |
text = f'''
|
63 |
You are an AI designed to extract structured information from unstructured text. Your task is to analyze the content of a candidate's CV and extract the following details:
|
@@ -97,11 +97,10 @@ def LLM_Inference(cv_text):
|
|
97 |
|
98 |
Do not explain, comment or make up any more information that is not relative to the list of Information extraction. Respond in Vietnamese. Let's work this out in a step by step way to ensure the correct answer. [END].
|
99 |
'''
|
100 |
-
text = 'short answer on who Lê Duẩn is'
|
101 |
inputs = tokenizer(text, return_tensors='pt').to(device)
|
102 |
with torch.no_grad():
|
103 |
outputs = model.generate(
|
104 |
-
**inputs, max_new_tokens=
|
105 |
)
|
106 |
return tokenizer.decode(outputs[0], skip_special_tokens=True)
|
107 |
|
|
|
57 |
return output
|
58 |
|
59 |
|
60 |
+
@spaces.GPU(duration=30)
|
61 |
def LLM_Inference(cv_text):
|
62 |
text = f'''
|
63 |
You are an AI designed to extract structured information from unstructured text. Your task is to analyze the content of a candidate's CV and extract the following details:
|
|
|
97 |
|
98 |
Do not explain, comment or make up any more information that is not relative to the list of Information extraction. Respond in Vietnamese. Let's work this out in a step by step way to ensure the correct answer. [END].
|
99 |
'''
|
|
|
100 |
inputs = tokenizer(text, return_tensors='pt').to(device)
|
101 |
with torch.no_grad():
|
102 |
outputs = model.generate(
|
103 |
+
**inputs, max_new_tokens=2048, pad_token_id = tokenizer.eos_token_id
|
104 |
)
|
105 |
return tokenizer.decode(outputs[0], skip_special_tokens=True)
|
106 |
|