Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,10 +2,10 @@
|
|
| 2 |
from google import genai
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
-
API_KEY = "
|
| 6 |
|
| 7 |
client = genai.Client(api_key=API_KEY)
|
| 8 |
-
MODEL_NAME = "gemini-
|
| 9 |
|
| 10 |
|
| 11 |
def generate_main_question_gemini(paragraph: str):
|
|
@@ -25,7 +25,7 @@ def generate_main_question_gemini(paragraph: str):
|
|
| 25 |
response = client.models.generate_content(model=MODEL_NAME, contents=prompt)
|
| 26 |
return response.text.strip()
|
| 27 |
except Exception as e:
|
| 28 |
-
return f"
|
| 29 |
|
| 30 |
|
| 31 |
with gr.Blocks() as demo:
|
|
|
|
| 2 |
from google import genai
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
+
API_KEY = "AIzaSyB4JKubDJd7nLx1NqPhDfMGeVWeQ7kqClY"
|
| 6 |
|
| 7 |
client = genai.Client(api_key=API_KEY)
|
| 8 |
+
MODEL_NAME = "gemini-2.0-flash"
|
| 9 |
|
| 10 |
|
| 11 |
def generate_main_question_gemini(paragraph: str):
|
|
|
|
| 25 |
response = client.models.generate_content(model=MODEL_NAME, contents=prompt)
|
| 26 |
return response.text.strip()
|
| 27 |
except Exception as e:
|
| 28 |
+
return f" Error while connecting to API: {e}"
|
| 29 |
|
| 30 |
|
| 31 |
with gr.Blocks() as demo:
|