robertselvam commited on
Commit
4d7ad53
·
verified ·
1 Parent(s): f1efac8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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 OpenAI
8
 
9
  class ResumeAnalyser:
10
  def __init__(self):
11
- pass
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
- client = OpenAI()
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="gpt-3.5-turbo",
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,