Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,11 +4,11 @@ import os
|
|
4 |
import openai
|
5 |
import re
|
6 |
import plotly.graph_objects as go
|
7 |
-
from openai import
|
8 |
|
9 |
class ResumeAnalyser:
|
10 |
def __init__(self):
|
11 |
-
|
12 |
def extract_text_from_file(self,file_path):
|
13 |
# Get the file extension
|
14 |
file_extension = os.path.splitext(file_path)[1]
|
@@ -38,7 +38,7 @@ class ResumeAnalyser:
|
|
38 |
def responce_from_ai(self,textjd, textcv):
|
39 |
job_description = self.extract_text_from_file(textjd)
|
40 |
resume = self.extract_text_from_file(textcv)
|
41 |
-
|
42 |
conversation = [
|
43 |
{"role": "system", "content": "You are a Reason Analyser"},
|
44 |
{"role": "user", "content": f"""
|
@@ -51,8 +51,8 @@ class ResumeAnalyser:
|
|
51 |
Keywords : [give me a matched key words from {job_description} and {resume}].
|
52 |
"""}
|
53 |
]
|
54 |
-
response = client.chat.completions.create(
|
55 |
-
model="
|
56 |
messages=conversation,
|
57 |
temperature=0,
|
58 |
max_tokens=500,
|
|
|
4 |
import openai
|
5 |
import re
|
6 |
import plotly.graph_objects as go
|
7 |
+
from openai import AzureOpenAI
|
8 |
|
9 |
class ResumeAnalyser:
|
10 |
def __init__(self):
|
11 |
+
self.client = AzureOpenAI()
|
12 |
def extract_text_from_file(self,file_path):
|
13 |
# Get the file extension
|
14 |
file_extension = os.path.splitext(file_path)[1]
|
|
|
38 |
def responce_from_ai(self,textjd, textcv):
|
39 |
job_description = self.extract_text_from_file(textjd)
|
40 |
resume = self.extract_text_from_file(textcv)
|
41 |
+
|
42 |
conversation = [
|
43 |
{"role": "system", "content": "You are a Reason Analyser"},
|
44 |
{"role": "user", "content": f"""
|
|
|
51 |
Keywords : [give me a matched key words from {job_description} and {resume}].
|
52 |
"""}
|
53 |
]
|
54 |
+
response = self.client.chat.completions.create(
|
55 |
+
model="ChatGPT",
|
56 |
messages=conversation,
|
57 |
temperature=0,
|
58 |
max_tokens=500,
|