Update app.py
Browse files
app.py
CHANGED
@@ -5,10 +5,10 @@ import os
|
|
5 |
import sys
|
6 |
import datetime
|
7 |
import boto3
|
|
|
8 |
|
9 |
openai.api_key = os.environ["OPENAI_API_KEY"]
|
10 |
|
11 |
-
|
12 |
s3 = boto3.client(
|
13 |
's3',
|
14 |
aws_access_key_id=os.environ["AWS_ACCESS_KEY_ID"],
|
@@ -29,7 +29,9 @@ def evaluate(
|
|
29 |
|
30 |
df_result = pd.DataFrame([[instruction, input, None, None],],columns=["instruction" ,"input", "output", "total_tokens"])
|
31 |
|
32 |
-
|
|
|
|
|
33 |
response = openai.ChatCompletion.create(
|
34 |
model="gpt-3.5-turbo",
|
35 |
# model="gpt-4",
|
|
|
5 |
import sys
|
6 |
import datetime
|
7 |
import boto3
|
8 |
+
from langdetect import detect
|
9 |
|
10 |
openai.api_key = os.environ["OPENAI_API_KEY"]
|
11 |
|
|
|
12 |
s3 = boto3.client(
|
13 |
's3',
|
14 |
aws_access_key_id=os.environ["AWS_ACCESS_KEY_ID"],
|
|
|
29 |
|
30 |
df_result = pd.DataFrame([[instruction, input, None, None],],columns=["instruction" ,"input", "output", "total_tokens"])
|
31 |
|
32 |
+
lang = detect(message)
|
33 |
+
|
34 |
+
if os.environ["PROMPT2"] not in message and lang == "ja":
|
35 |
response = openai.ChatCompletion.create(
|
36 |
model="gpt-3.5-turbo",
|
37 |
# model="gpt-4",
|