Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,20 +51,19 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 51 |
|
| 52 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 53 |
try:
|
| 54 |
-
agent = BasicAgent()
|
| 55 |
load_dotenv()
|
|
|
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
# -----------------------------
|
| 60 |
-
#llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
|
| 61 |
-
#repo_id="deepseek-ai/DeepSeek-V4-Pro"
|
| 62 |
-
|
| 63 |
-
llm=HuggingFaceEndpoint(
|
| 64 |
repo_id="Qwen/Qwen2.5-Coder-32B-Instruct",
|
| 65 |
huggingfacehub_api_token=HF_KEY,
|
| 66 |
-
task="
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
|
| 70 |
# -----------------------------
|
|
|
|
| 51 |
|
| 52 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 53 |
try:
|
|
|
|
| 54 |
load_dotenv()
|
| 55 |
+
HF_KEY = os.getenv("HF_TOKEN")
|
| 56 |
|
| 57 |
+
llm = ChatHuggingFace(
|
| 58 |
+
llm=HuggingFaceEndpoint(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
repo_id="Qwen/Qwen2.5-Coder-32B-Instruct",
|
| 60 |
huggingfacehub_api_token=HF_KEY,
|
| 61 |
+
task="text-generation",
|
| 62 |
+
)
|
| 63 |
+
)
|
| 64 |
+
except Exception as e:
|
| 65 |
+
print(f"Error instantiating agent: {e}")
|
| 66 |
+
return f"Error initializing agent: {e}", None
|
| 67 |
|
| 68 |
|
| 69 |
# -----------------------------
|