Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -254,6 +254,7 @@ def generate_text(df, country, theme):
|
|
| 254 |
Adverse 2021: -1.99%
|
| 255 |
Adverse 2022: -1.20%
|
| 256 |
Adverse Cumulative: -3.57%
|
|
|
|
| 257 |
|
| 258 |
Description:
|
| 259 |
In the adverse scenario, the GDP growth in Australia was -0.43% in 2020. It decreased further to -1.99% in 2021, showing worsening conditions. However, there was a slight improvement to -1.20% in 2022. The total cumulative adverse growth is -3.57%.
|
|
@@ -266,14 +267,14 @@ def generate_text(df, country, theme):
|
|
| 266 |
|
| 267 |
Data:
|
| 268 |
{row_str}
|
| 269 |
-
|
| 270 |
-
|
| 271 |
"""
|
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
# Generate the descriptive text using the model
|
| 276 |
-
result = table_to_text(prompt, max_length=200, temperature =
|
| 277 |
|
| 278 |
return result
|
| 279 |
# Global variable
|
|
|
|
| 254 |
Adverse 2021: -1.99%
|
| 255 |
Adverse 2022: -1.20%
|
| 256 |
Adverse Cumulative: -3.57%
|
| 257 |
+
Topic: GDP
|
| 258 |
|
| 259 |
Description:
|
| 260 |
In the adverse scenario, the GDP growth in Australia was -0.43% in 2020. It decreased further to -1.99% in 2021, showing worsening conditions. However, there was a slight improvement to -1.20% in 2022. The total cumulative adverse growth is -3.57%.
|
|
|
|
| 267 |
|
| 268 |
Data:
|
| 269 |
{row_str}
|
| 270 |
+
Topic: {theme}
|
| 271 |
+
Make sure your description follows the example format and accurately reflects the data.
|
| 272 |
"""
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
# Generate the descriptive text using the model
|
| 277 |
+
result = table_to_text(prompt, max_length=200, temperature = 0.2, top_p = 0.3)[0]['generated_text']
|
| 278 |
|
| 279 |
return result
|
| 280 |
# Global variable
|