tharun1507 commited on
Commit
ec0a5b6
·
verified ·
1 Parent(s): d68d9be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -13,7 +13,7 @@ import google.generativeai as palm
13
 
14
  # load model
15
  # PaLM API Key here
16
- palm.configure(api_key='AIzaSyCkBTxQSWr-yVphJ6XdPzOypLr-RwfLRbA')
17
  # Use the palm.list_models function to find available models
18
  # PaLM 2 available in 4 sizes: Gecko, Otter, Bison and Unicorn (largest)
19
  models = [m for m in palm.list_models() if 'generateText' in m.supported_generation_methods]
@@ -64,7 +64,7 @@ def get_completion(code_snippet):
64
  ```
65
  """
66
 
67
- completion = palm.generate_text(
68
  model=model,
69
  prompt=prompt,
70
  temperature=0,
@@ -77,9 +77,11 @@ def get_completion(code_snippet):
77
  # define app UI
78
  iface = gr.Interface(fn=get_completion, inputs=[gr.Textbox(label="Insert Code Snippet",lines=5)],
79
  outputs=[gr.Textbox(label="Explanation Here",lines=8)],
80
- title="DECIPHER \n The Python Code Explainer \n AI Capstone Project(XII-C)"
81
  )
82
 
83
  iface.launch()
84
 
85
 
 
 
 
13
 
14
  # load model
15
  # PaLM API Key here
16
+ gemini.configure(api_key='AIzaSyArybMiPDZARDCz7yZBjzEMx6zXgOXHtoc')
17
  # Use the palm.list_models function to find available models
18
  # PaLM 2 available in 4 sizes: Gecko, Otter, Bison and Unicorn (largest)
19
  models = [m for m in palm.list_models() if 'generateText' in m.supported_generation_methods]
 
64
  ```
65
  """
66
 
67
+ completion = gemini.generate_text(
68
  model=model,
69
  prompt=prompt,
70
  temperature=0,
 
77
  # define app UI
78
  iface = gr.Interface(fn=get_completion, inputs=[gr.Textbox(label="Insert Code Snippet",lines=5)],
79
  outputs=[gr.Textbox(label="Explanation Here",lines=8)],
80
+ title="Code Explainer"
81
  )
82
 
83
  iface.launch()
84
 
85
 
86
+
87
+