Hmd6919 commited on
Commit
ebd8be1
·
verified ·
1 Parent(s): 9fd9ed7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -16
app.py CHANGED
@@ -1,21 +1,11 @@
1
-
2
  import os
3
- import subprocess
4
- import sys
5
- import importlib
 
6
 
7
- # 1. Force-install and RELOAD the library if the import fails
8
- try:
9
- from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
10
- except ImportError:
11
- print("⚠️ Installing smolagents from source...")
12
- subprocess.check_call([sys.executable, "-m", "pip", "install", "git+https://github.com/huggingface/smolagents.git"])
13
-
14
- # 💡 CRITICAL STEP: Force Python to reload the module we just installed
15
- import smolagents
16
- importlib.reload(smolagents)
17
-
18
- from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
19
  import gradio as gr
20
  import requests
21
  import pandas as pd
 
 
1
  import os
2
+ import gradio as gr
3
+ import requests
4
+ import pandas as pd
5
+ from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
6
 
7
+ # --- Constants ---
8
+ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
 
 
 
 
 
 
 
 
 
 
9
  import gradio as gr
10
  import requests
11
  import pandas as pd