MrunmayD commited on
Commit
919137a
·
verified ·
1 Parent(s): 3980122

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -4,6 +4,8 @@ import requests
4
  import inspect
5
  import pandas as pd
6
  from smolagents import CodeAgent, GoogleSearchTool, InferenceClientModel, VisitWebpageTool
 
 
7
 
8
  # (Keep Constants as is)
9
  # --- Constants ---
@@ -37,9 +39,15 @@ final_answer(
37
  Do NOT forget the triple backticks and the `<end_code>` tag — they are required for evaluation.
38
  Even if you can't answer the question fully, always provide reasoning and return a final_answer block.
39
  """
40
- model = InferenceClientModel(
41
- model_id="Qwen/Qwen2.5-Coder-7B-Instruct",
 
 
 
 
 
42
  )
 
43
  # --- Basic Agent Definition ---
44
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
45
  class BasicAgent:
 
4
  import inspect
5
  import pandas as pd
6
  from smolagents import CodeAgent, GoogleSearchTool, InferenceClientModel, VisitWebpageTool
7
+ from transformers import AutoTokenizer, AutoModelForCausalLM
8
+
9
 
10
  # (Keep Constants as is)
11
  # --- Constants ---
 
39
  Do NOT forget the triple backticks and the `<end_code>` tag — they are required for evaluation.
40
  Even if you can't answer the question fully, always provide reasoning and return a final_answer block.
41
  """
42
+
43
+ model_name = "Qwen/Qwen2.5-Coder-7B-Instruct"
44
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
45
+ model = AutoModelForCausalLM.from_pretrained(
46
+ model_name,
47
+ torch_dtype="auto",
48
+ device_map="auto"
49
  )
50
+
51
  # --- Basic Agent Definition ---
52
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
53
  class BasicAgent: