mgokg commited on
Commit
1d18bae
·
verified ·
1 Parent(s): 5a31b21

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -3,7 +3,7 @@ import os
3
  import google.generativeai as genai
4
  import logging
5
  import time
6
- #import backoff
7
 
8
  # Configure Logging
9
  logging.basicConfig(level=logging.ERROR, format='%(asctime)s - %(levelname)s - %(message)s')
@@ -28,9 +28,9 @@ custom_css = """
28
  }
29
  """
30
 
31
- #@backoff.on_exception(backoff.expo,
32
- #(genai.APIError),
33
- #max_tries=3) # retry up to 3 times
34
  def predict(prompt):
35
  # Create the model
36
  generation_config = {
 
3
  import google.generativeai as genai
4
  import logging
5
  import time
6
+ import backoff
7
 
8
  # Configure Logging
9
  logging.basicConfig(level=logging.ERROR, format='%(asctime)s - %(levelname)s - %(message)s')
 
28
  }
29
  """
30
 
31
+ @backoff.on_exception(backoff.expo,
32
+ (genai.APIError),
33
+ max_tries=3) # retry up to 3 times
34
  def predict(prompt):
35
  # Create the model
36
  generation_config = {