KarthickAdopleAI commited on
Commit
44a5de1
·
verified ·
1 Parent(s): 25e4fe2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -3,7 +3,7 @@ import openai
3
  import PyPDF2
4
  import gradio as gr
5
  import docx
6
- from openai import OpenAI
7
 
8
  class CourseGenarator:
9
  def __init__(self):
@@ -43,7 +43,11 @@ class CourseGenarator:
43
  return "Unsupported file type"
44
 
45
  def response(self,resume_path):
46
- client = OpenAI()
 
 
 
 
47
  resume_path = resume_path.name
48
  resume = self.extract_text_from_file(resume_path)
49
 
@@ -56,7 +60,7 @@ class CourseGenarator:
56
 
57
  # Call OpenAI GPT-3.5-turbo
58
  chat_completion = client.chat.completions.create(
59
- model = "gpt-3.5-turbo",
60
  messages = conversation,
61
  max_tokens=500,
62
  temperature=0
 
3
  import PyPDF2
4
  import gradio as gr
5
  import docx
6
+ from openai import AzureOpenAI
7
 
8
  class CourseGenarator:
9
  def __init__(self):
 
43
  return "Unsupported file type"
44
 
45
  def response(self,resume_path):
46
+ client = AzureOpenAI(api_key=os.getenv("AZURE_OPENAI_KEY"),
47
+ api_version="2023-07-01-preview",
48
+ azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
49
+ )
50
+
51
  resume_path = resume_path.name
52
  resume = self.extract_text_from_file(resume_path)
53
 
 
60
 
61
  # Call OpenAI GPT-3.5-turbo
62
  chat_completion = client.chat.completions.create(
63
+ model = "ChatGPT",
64
  messages = conversation,
65
  max_tokens=500,
66
  temperature=0