Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,16 +34,16 @@ def generate_checklist(pdf_file):
|
|
| 34 |
Structured Checklist:
|
| 35 |
"""
|
| 36 |
|
| 37 |
-
|
| 38 |
-
response = client.chat.completions.create(
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
)
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
|
| 48 |
return checklist
|
| 49 |
|
|
|
|
| 34 |
Structured Checklist:
|
| 35 |
"""
|
| 36 |
|
| 37 |
+
try:
|
| 38 |
+
response = client.chat.completions.create(
|
| 39 |
+
model="gpt-4",
|
| 40 |
+
messages=[{"role": "system", "content": prompt}],
|
| 41 |
+
temperature=0.3,
|
| 42 |
+
max_tokens=800
|
| 43 |
+
)
|
| 44 |
+
checklist = response.choices[0].message.content
|
| 45 |
+
except Exception as e:
|
| 46 |
+
checklist = f"Error generating checklist: {str(e)}"
|
| 47 |
|
| 48 |
return checklist
|
| 49 |
|