tharun1507 commited on
Commit
06721a6
·
verified ·
1 Parent(s): 78b65d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -1,16 +1,12 @@
1
  # -*- coding: utf-8 -*-
2
 
3
- # Import necessary libraries
4
  import gradio as gr
5
  import google.generativeai as genai
6
 
7
  # Configure the API key
8
  genai.configure(api_key='AIzaSyYourGenAIKeyHere')
9
 
10
- # Load the generative model using the GenerativeModel class
11
- model = genai.GenerativeModel(name="gemini", version="v1")
12
-
13
- # Define the completion function using generate_content
14
  def get_completion(code_snippet):
15
  python_code_examples = """
16
  ---------------------
@@ -56,7 +52,7 @@ def get_completion(code_snippet):
56
  """
57
 
58
  # Generate content using the unified method
59
- completion = model.generate_content(
60
  prompt=prompt,
61
  temperature=0,
62
  max_output_tokens=500,
 
1
  # -*- coding: utf-8 -*-
2
 
 
3
  import gradio as gr
4
  import google.generativeai as genai
5
 
6
  # Configure the API key
7
  genai.configure(api_key='AIzaSyYourGenAIKeyHere')
8
 
9
+ # Define the completion function using the unified generate_content method
 
 
 
10
  def get_completion(code_snippet):
11
  python_code_examples = """
12
  ---------------------
 
52
  """
53
 
54
  # Generate content using the unified method
55
+ completion = genai.generate_content(
56
  prompt=prompt,
57
  temperature=0,
58
  max_output_tokens=500,