m3n99 commited on
Commit
44e509d
Β·
1 Parent(s): a36a19c

fix a bug

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -215,7 +215,7 @@ def call_gemini(topic: str, level: str, difficulty: int) -> str:
215
 
216
  client = genai.Client(api_key=GEMINI_API_KEY)
217
  response = client.models.generate_content(
218
- model="gemini-2.0-flash", # ← fixed: was "gemini-1.5-flash" (404)
219
  contents=build_user_prompt(topic, level, difficulty),
220
  config=types.GenerateContentConfig(
221
  system_instruction=SYSTEM_PROMPT,
@@ -502,7 +502,7 @@ body, .gradio-container {
502
  footer { display: none !important; }
503
  """
504
 
505
- with gr.Blocks(title="Prompt2Project", css=CSS, theme=gr.themes.Base()) as demo:
506
 
507
  # ── Header ──────────────────────────────────────────────────────────────
508
  gr.HTML("""
@@ -564,4 +564,4 @@ with gr.Blocks(title="Prompt2Project", css=CSS, theme=gr.themes.Base()) as demo:
564
  )
565
 
566
  if __name__ == "__main__":
567
- demo.launch()
 
215
 
216
  client = genai.Client(api_key=GEMINI_API_KEY)
217
  response = client.models.generate_content(
218
+ model="gemini-2.0-flash",
219
  contents=build_user_prompt(topic, level, difficulty),
220
  config=types.GenerateContentConfig(
221
  system_instruction=SYSTEM_PROMPT,
 
502
  footer { display: none !important; }
503
  """
504
 
505
+ with gr.Blocks(title="Prompt2Project", theme=gr.themes.Base()) as demo:
506
 
507
  # ── Header ──────────────────────────────────────────────────────────────
508
  gr.HTML("""
 
564
  )
565
 
566
  if __name__ == "__main__":
567
+ demo.launch(css=CSS)