Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -339,15 +339,15 @@ def generate_text(df, country, theme):
|
|
339 |
Example:
|
340 |
|
341 |
Country: Australia
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
|
347 |
Description:
|
348 |
In the adverse scenario, the growth in Australia was -0.43% in 1990. It worsened to -1.99% in 1991 and slightly improved to -1.20% in 1992. The total cumulative adverse growth was -3.57%.
|
349 |
|
350 |
-
Now, using the following data
|
351 |
{row_str}
|
352 |
"""
|
353 |
prompt1 = f"""
|
@@ -371,9 +371,9 @@ def generate_text(df, country, theme):
|
|
371 |
|
372 |
Now, describe the data for {country}.
|
373 |
"""
|
374 |
-
|
375 |
# Generate the descriptive text using the model
|
376 |
-
result = table_to_text(
|
377 |
|
378 |
return result
|
379 |
# Global variable
|
|
|
339 |
Example:
|
340 |
|
341 |
Country: Australia
|
342 |
+
1990: -0.43%
|
343 |
+
1991: -1.99%
|
344 |
+
1992: -1.20%
|
345 |
+
Cumulative: -3.57%
|
346 |
|
347 |
Description:
|
348 |
In the adverse scenario, the growth in Australia was -0.43% in 1990. It worsened to -1.99% in 1991 and slightly improved to -1.20% in 1992. The total cumulative adverse growth was -3.57%.
|
349 |
|
350 |
+
Now, using the following data in {country}, describe and provibe how the adverse growth changed each year, whether it increased or decreased, worsened or improved:
|
351 |
{row_str}
|
352 |
"""
|
353 |
prompt1 = f"""
|
|
|
371 |
|
372 |
Now, describe the data for {country}.
|
373 |
"""
|
374 |
+
print(year)
|
375 |
# Generate the descriptive text using the model
|
376 |
+
result = table_to_text(prompt, max_length=240, temperature = 0.7, top_p = 0.3, do_sample = False)[0]['generated_text']
|
377 |
|
378 |
return result
|
379 |
# Global variable
|