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