KarthickAdopleAI commited on
Commit
cf8d6fe
·
verified ·
1 Parent(s): 7a40c1a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -497,13 +497,15 @@ class JobPotral:
497
  # Convert CSV file to a list of reviews
498
  reviews = self.csv_to_list(file_path)
499
 
 
 
 
 
500
  # Construct the prompt for OpenAI API
501
- prompt = f"read and analyse to return suggestion reviews,postive reviews and negative reviews with label ***{reviews}***."
502
-
503
  # Call OpenAI API with the given prompt
504
  response = self.client.completions.create(
505
- model="text-davinci-003", # You can use a different engine
506
- prompt=prompt,
507
  max_tokens=200,
508
  temperature = 0,
509
  )
 
497
  # Convert CSV file to a list of reviews
498
  reviews = self.csv_to_list(file_path)
499
 
500
+ prompt = [
501
+ {"role": "system", "content": "You are a helpful assistant."},
502
+ {"role": "user", "content": f"""read and analyse to return suggestion reviews,postive reviews and negative reviews with label ***{reviews}***."""}
503
+ ]
504
  # Construct the prompt for OpenAI API
 
 
505
  # Call OpenAI API with the given prompt
506
  response = self.client.completions.create(
507
+ model="gpt-3.5-turbo", # You can use a different engine
508
+ messages=prompt,
509
  max_tokens=200,
510
  temperature = 0,
511
  )