Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,15 +6,14 @@
|
|
| 6 |
|
| 7 |
#@title DECIPHER THE CODE EXPLAINER
|
| 8 |
import gradio as gr
|
| 9 |
-
import google.generativeai as
|
| 10 |
|
| 11 |
# load model
|
| 12 |
# PaLM API Key here
|
| 13 |
-
|
| 14 |
# Use the palm.list_models function to find available models
|
| 15 |
# PaLM 2 available in 4 sizes: Gecko, Otter, Bison and Unicorn (largest)
|
| 16 |
-
models =
|
| 17 |
-
model = models[0].name
|
| 18 |
# define completion function
|
| 19 |
def get_completion(code_snippet):
|
| 20 |
|
|
@@ -61,7 +60,7 @@ def get_completion(code_snippet):
|
|
| 61 |
```
|
| 62 |
"""
|
| 63 |
|
| 64 |
-
completion =
|
| 65 |
model=model,
|
| 66 |
prompt=prompt,
|
| 67 |
temperature=0,
|
|
|
|
| 6 |
|
| 7 |
#@title DECIPHER THE CODE EXPLAINER
|
| 8 |
import gradio as gr
|
| 9 |
+
import google.generativeai as genai
|
| 10 |
|
| 11 |
# load model
|
| 12 |
# PaLM API Key here
|
| 13 |
+
genai.configure(api_key='AIzaSyArybMiPDZARDCz7yZBjzEMx6zXgOXHtoc')
|
| 14 |
# Use the palm.list_models function to find available models
|
| 15 |
# PaLM 2 available in 4 sizes: Gecko, Otter, Bison and Unicorn (largest)
|
| 16 |
+
models =genai.GenerativeModel(gemini-1.0-pro)
|
|
|
|
| 17 |
# define completion function
|
| 18 |
def get_completion(code_snippet):
|
| 19 |
|
|
|
|
| 60 |
```
|
| 61 |
"""
|
| 62 |
|
| 63 |
+
completion = genai.generate_text(
|
| 64 |
model=model,
|
| 65 |
prompt=prompt,
|
| 66 |
temperature=0,
|