Cachoups commited on
Commit
ae8ac16
·
verified ·
1 Parent(s): 1bfee56

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -248,6 +248,7 @@ def generate_text(df, country, theme):
248
  """
249
  prompt = f"""
250
  Here is an example of how to describe adverse growth data for a given country:
 
251
  Country: Australia
252
  Adverse 1990: -0.43%
253
  Adverse 1991: -1.99%
@@ -262,7 +263,7 @@ def generate_text(df, country, theme):
262
  {row_str}
263
  Topic: {theme}
264
 
265
- Your task is to describe the changes in the provided data year by year, just like in the example. Focus only on the provided country and values, and do not introduce any new countries or years. Ensure the description follows the pattern in the example, highlighting whether the values increased or decreased each year.
266
  """
267
  prompt1 = f"""
268
  Here is an example of how to describe adverse growth data for a given country:
@@ -290,7 +291,7 @@ def generate_text(df, country, theme):
290
  """
291
 
292
  # Generate the descriptive text using the model
293
- result = table_to_text(prompt, max_length=240, temperature = 0.7, do_sample = True)[0]['generated_text']
294
 
295
  return result
296
  # Global variable
 
248
  """
249
  prompt = f"""
250
  Here is an example of how to describe adverse growth data for a given country:
251
+
252
  Country: Australia
253
  Adverse 1990: -0.43%
254
  Adverse 1991: -1.99%
 
263
  {row_str}
264
  Topic: {theme}
265
 
266
+ Describe the changes in the provided data year by year, just like in the example. Focus only on the provided country and values, and do not introduce any new countries or years. Ensure the description follows the pattern in the example, highlighting whether the values increased or decreased each year.
267
  """
268
  prompt1 = f"""
269
  Here is an example of how to describe adverse growth data for a given country:
 
291
  """
292
 
293
  # Generate the descriptive text using the model
294
+ result = table_to_text(prompt, max_length=240, temperature = 0.7, top_p = 0.3 do_sample = True)[0]['generated_text']
295
 
296
  return result
297
  # Global variable