Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -52,15 +52,16 @@ class GenerateResponse4(BaseModel):
|
|
| 52 |
|
| 53 |
#Summarize function
|
| 54 |
def summarize_text(text: str):
|
| 55 |
-
response = client.completions.create(
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
|
|
|
| 64 |
if response.choices:
|
| 65 |
# Extract the text from the response
|
| 66 |
summary = response.choices[0].text.strip()
|
|
|
|
| 52 |
|
| 53 |
#Summarize function
|
| 54 |
def summarize_text(text: str):
|
| 55 |
+
response = client.completions.create(
|
| 56 |
+
model = deployment_name,
|
| 57 |
+
#engine="AmplifAI-Chat",
|
| 58 |
+
prompt="The data is a pre-recorded conversation between a call center agent and a customer. Identify the following: keywords/metrics about the conversation, a summary of the conversation including details. Output should be in the format Keywords/Metrics: ,\n Summary:. \n Data: " + text,
|
| 59 |
+
temperature=0.7,
|
| 60 |
+
max_tokens=750,
|
| 61 |
+
top_p=1.0,
|
| 62 |
+
frequency_penalty=0.0,
|
| 63 |
+
presence_penalty=0.0
|
| 64 |
+
)
|
| 65 |
if response.choices:
|
| 66 |
# Extract the text from the response
|
| 67 |
summary = response.choices[0].text.strip()
|