Spaces:
Runtime error
Runtime error
Commit
•
5aa708b
1
Parent(s):
677a99e
Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,10 @@ def generate_script(host_name, listener_location, causes_climate_change, co2_lev
|
|
27 |
|
28 |
# Generate the script using the language model
|
29 |
script = generator.text_generation(prompt_template)[0]['generated_text']
|
30 |
-
|
|
|
|
|
|
|
31 |
# Split the script into sections
|
32 |
sections = script.split("\n")
|
33 |
|
|
|
27 |
|
28 |
# Generate the script using the language model
|
29 |
script = generator.text_generation(prompt_template)[0]['generated_text']
|
30 |
+
if isinstance(response, list):
|
31 |
+
script = response[0].get('generated_text', '')
|
32 |
+
else:
|
33 |
+
script = response.get('generated_text', '')
|
34 |
# Split the script into sections
|
35 |
sections = script.split("\n")
|
36 |
|