Besimplestudio commited on
Commit
d0ed63e
·
verified ·
1 Parent(s): 15fd6eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -9
app.py CHANGED
@@ -46,7 +46,7 @@ def analyze_coloring_trends(region='US'):
46
  else:
47
  print(f"No data for category: {category}")
48
 
49
- time.sleep(1) # Pause to respect Google Trends rate limits
50
 
51
  except Exception as e:
52
  print(f"Error fetching data for {category}: {e}")
@@ -91,18 +91,12 @@ def analyze_coloring_trends(region='US'):
91
 
92
  return fig, top_keywords_str, recommendations
93
 
94
- # Create Gradio interface with a comprehensive list of regions
95
  iface = gr.Interface(
96
  fn=analyze_coloring_trends,
97
  inputs=[
98
  gr.Dropdown(
99
- choices=[
100
- 'US', 'UK', 'CA', 'AU', 'DE', 'FR', 'ES', 'IT', 'JP', 'BR', 'IN',
101
- 'RU', 'MX', 'ZA', 'KR', 'NL', 'TR', 'ID', 'PL', 'SE', 'NO', 'CH',
102
- 'AR', 'CO', 'CL', 'NZ', 'PT', 'PH', 'MY', 'SG', 'TH', 'IE', 'AT',
103
- 'BE', 'DK', 'FI', 'GR', 'HU', 'IL', 'CN', 'TW', 'HK', 'CZ', 'AE',
104
- 'SA', 'EG', 'PK', 'VN'
105
- ],
106
  label="Select Region",
107
  value="US" # Set default region using 'value'
108
  )
 
46
  else:
47
  print(f"No data for category: {category}")
48
 
49
+ time.sleep(3) # Increase delay to avoid rate limiting
50
 
51
  except Exception as e:
52
  print(f"Error fetching data for {category}: {e}")
 
91
 
92
  return fig, top_keywords_str, recommendations
93
 
94
+ # Create Gradio interface with a refined list of supported regions
95
  iface = gr.Interface(
96
  fn=analyze_coloring_trends,
97
  inputs=[
98
  gr.Dropdown(
99
+ choices=['US', 'UK', 'CA', 'AU', 'DE', 'FR', 'ES', 'IT', 'JP', 'BR', 'IN'],
 
 
 
 
 
 
100
  label="Select Region",
101
  value="US" # Set default region using 'value'
102
  )