codeteach commited on
Commit
806e430
1 Parent(s): 2068870

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -21,14 +21,12 @@ def extract_text_from_pdf(pdf_file):
21
  return text
22
 
23
  def generate_summary(text):
24
- response = openai.ChatCompletion.create(
25
- model="gpt-3.5-turbo",
26
- messages=[
27
- {"role": "system", "content": "You are a summarization assistant."},
28
- {"role": "user", "content": f"Please summarize the following text: {text}"}
29
- ]
30
  )
31
- summary = response['choices'][0]['message']['content'].strip()
32
  return summary
33
 
34
  def evaluate_text_against_rubric(rubric_text, text):
@@ -125,3 +123,4 @@ interface.launch()
125
 
126
 
127
 
 
 
21
  return text
22
 
23
  def generate_summary(text):
24
+ response = openai.Completion.create(
25
+ engine="text-davinci-003",
26
+ prompt=f"Please summarize the following text: {text}",
27
+ max_tokens=100
 
 
28
  )
29
+ summary = response['choices'][0]['text'].strip()
30
  return summary
31
 
32
  def evaluate_text_against_rubric(rubric_text, text):
 
123
 
124
 
125
 
126
+