Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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="
|
506 |
-
|
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 |
)
|