robertselvam commited on
Commit
b96e25e
1 Parent(s): ef7d741

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -79,17 +79,15 @@ class Summarizer:
79
  # openai.api_key=os.getenv("OPENAI_API_KEY")
80
  pass
81
  def generate_summary(self, text):
82
- model_engine = "text-davinci-003"
83
- prompt = f"""summarize the following conversation delimited by triple backticks. write within 30 words.```{text}``` """
84
  completions = client.completions.create(
85
- engine=model_engine,
86
- prompt=prompt,
87
  max_tokens=60,
88
  n=1,
89
  stop=None,
90
  temperature=0.5,
91
  )
92
- message = completions.choices[0].text.strip()
93
  return message
94
 
95
  history_state = gr.State()
 
79
  # openai.api_key=os.getenv("OPENAI_API_KEY")
80
  pass
81
  def generate_summary(self, text):
 
 
82
  completions = client.completions.create(
83
+ model="text-davinci-003",
84
+ prompt=f"""summarize the following conversation delimited by triple backticks. write within 30 words.```{text}``` """,
85
  max_tokens=60,
86
  n=1,
87
  stop=None,
88
  temperature=0.5,
89
  )
90
+ message = completions.choices[0].text
91
  return message
92
 
93
  history_state = gr.State()