Spaces:
Runtime error
Runtime error
Jforeverss
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ def preprocess_pdf(pdf_path, tokenizer):
|
|
60 |
|
61 |
def translate_text(text, target_language):
|
62 |
response = openai.ChatCompletion.create(
|
63 |
-
model="gpt-
|
64 |
messages=[
|
65 |
{"role": "system", "content": "You are a helpful assistant that translates English text to other languages."},
|
66 |
{"role": "user", "content": f'Translate the following English text to {target_language}: "{text}"'},
|
@@ -70,7 +70,7 @@ def translate_text(text, target_language):
|
|
70 |
|
71 |
def explain_term(term):
|
72 |
response = openai.ChatCompletion.create(
|
73 |
-
model="gpt-
|
74 |
messages=[
|
75 |
{
|
76 |
"role": "system",
|
@@ -144,7 +144,7 @@ if uploaded_file is not None:
|
|
144 |
chat_history = "\n".join([sentence[0] for sentence in top_5_sentences])
|
145 |
|
146 |
response = openai.ChatCompletion.create(
|
147 |
-
model="gpt-
|
148 |
messages=[
|
149 |
{"role": "system", "content": "You are a helpful generator which read the short paragraphs and answer the question."},
|
150 |
{"role": "user", "content": chat_history},
|
|
|
60 |
|
61 |
def translate_text(text, target_language):
|
62 |
response = openai.ChatCompletion.create(
|
63 |
+
model="gpt-4-1106-preview",
|
64 |
messages=[
|
65 |
{"role": "system", "content": "You are a helpful assistant that translates English text to other languages."},
|
66 |
{"role": "user", "content": f'Translate the following English text to {target_language}: "{text}"'},
|
|
|
70 |
|
71 |
def explain_term(term):
|
72 |
response = openai.ChatCompletion.create(
|
73 |
+
model="gpt-4-1106-preview",
|
74 |
messages=[
|
75 |
{
|
76 |
"role": "system",
|
|
|
144 |
chat_history = "\n".join([sentence[0] for sentence in top_5_sentences])
|
145 |
|
146 |
response = openai.ChatCompletion.create(
|
147 |
+
model="gpt-4-1106-preview",
|
148 |
messages=[
|
149 |
{"role": "system", "content": "You are a helpful generator which read the short paragraphs and answer the question."},
|
150 |
{"role": "user", "content": chat_history},
|