lethaq commited on
Commit
f483c70
·
verified ·
1 Parent(s): 5909f48

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -220,7 +220,7 @@ class CodeAgent:
220
 
221
  if '.remna eht sa "tfel" drow eht fo etisoppo eht etirw' in question_lower:
222
  should_search = False
223
- if "chess position provided in the image" in question_lower or "image." in question_lower:
224
  should_search = False
225
 
226
  search_results = None
@@ -394,7 +394,7 @@ with gr.Blocks() as demo:
394
 
395
  gr.Markdown("## Test Single Question")
396
  with gr.Row():
397
- question_in = gr.Textbox(label="Question", lines=3,秀传placeholder="Enter your question here...")
398
  answer_out = gr.Textbox(label="Answer", lines=3, interactive=False)
399
 
400
  test_btn = gr.Button("Test Question", variant="secondary")
@@ -407,7 +407,7 @@ with gr.Blocks() as demo:
407
  if not api_key:
408
  return "Error: GEMINI_API_KEY environment variable not found"
409
 
410
- model = LiteLLMModel(model_id="gemini/gemini-2.0-flash-lite", api_key=AIzaSyAhmwogxZFBtt7_OUsKQGNeOYF7ced39bM)
411
  agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model)
412
  answer = agent(question)
413
  return answer
@@ -446,9 +446,8 @@ if __name__ == "__main__":
446
  print("-"*(60 + len(" App Starting ")) + "\n")
447
 
448
  print("Launching Gradio Interface for Gemini Agent Evaluation...")
449
- # For Hugging Face Spaces, share=True is often not needed or handled by the platform.
450
- # debug=True can be helpful during development.
451
  demo.launch(debug=False, share=False)
452
 
453
 
454
 
 
 
220
 
221
  if '.remna eht sa "tfel" drow eht fo etisoppo eht etirw' in question_lower:
222
  should_search = False
223
+ if "chess position provided in the image" in question_lower or "image." in question_lower: # Further refine to avoid search if "image" implies visual input
224
  should_search = False
225
 
226
  search_results = None
 
394
 
395
  gr.Markdown("## Test Single Question")
396
  with gr.Row():
397
+ question_in = gr.Textbox(label="Question", lines=3, placeholder="Enter your question here...") # <--- FIX APPLIED HERE
398
  answer_out = gr.Textbox(label="Answer", lines=3, interactive=False)
399
 
400
  test_btn = gr.Button("Test Question", variant="secondary")
 
407
  if not api_key:
408
  return "Error: GEMINI_API_KEY environment variable not found"
409
 
410
+ model = LiteLLMModel(model_id="gemini/gemini-2.0-flash-lite", api_key=api_key)
411
  agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model)
412
  answer = agent(question)
413
  return answer
 
446
  print("-"*(60 + len(" App Starting ")) + "\n")
447
 
448
  print("Launching Gradio Interface for Gemini Agent Evaluation...")
 
 
449
  demo.launch(debug=False, share=False)
450
 
451
 
452
 
453
+