nadim71 commited on
Commit
c61c3aa
·
verified ·
1 Parent(s): 1084ca1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
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
- # LLM
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="conversational", # Specify task for the conversational model
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
  # -----------------------------