Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -240,11 +240,11 @@ def generate_text(df, country, theme):
|
|
240 |
Description:
|
241 |
In the adverse scenario, the GDP growth in Australia was -0.43% in 1990. It decreased further to -1.99% in 1991, showing worsening conditions. There was a slight improvement to -1.20% in 1992. The total cumulative adverse growth is -3.57%.
|
242 |
|
243 |
-
Now, using the following data for {theme} in {country}
|
244 |
{row_str}
|
245 |
Topic: {theme}
|
246 |
|
247 |
-
|
248 |
"""
|
249 |
prompt1 = f"""
|
250 |
Here is an example of how to describe adverse growth data for a given country:
|
@@ -272,7 +272,7 @@ def generate_text(df, country, theme):
|
|
272 |
"""
|
273 |
|
274 |
# Generate the descriptive text using the model
|
275 |
-
result = table_to_text(prompt, max_length=
|
276 |
|
277 |
return result
|
278 |
# Global variable
|
|
|
240 |
Description:
|
241 |
In the adverse scenario, the GDP growth in Australia was -0.43% in 1990. It decreased further to -1.99% in 1991, showing worsening conditions. There was a slight improvement to -1.20% in 1992. The total cumulative adverse growth is -3.57%.
|
242 |
|
243 |
+
Now, using the following data for {theme} in {country}:
|
244 |
{row_str}
|
245 |
Topic: {theme}
|
246 |
|
247 |
+
Your task is to: describe the changes year by year, indicate whether the values increased or decreased, do not introduce new countries or years, and reflect the data as it appears in the table.
|
248 |
"""
|
249 |
prompt1 = f"""
|
250 |
Here is an example of how to describe adverse growth data for a given country:
|
|
|
272 |
"""
|
273 |
|
274 |
# Generate the descriptive text using the model
|
275 |
+
result = table_to_text(prompt, max_length=240)[0]['generated_text']
|
276 |
|
277 |
return result
|
278 |
# Global variable
|