Facelook commited on
Commit
b734332
·
1 Parent(s): 8b19b91

Trial and error.

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -7,10 +7,12 @@ from huggingface_hub import InferenceClient # Import Hugging Face InferenceClie
7
  import torch
8
  from transformers import AutoModelForCausalLM, AutoTokenizer
9
 
 
 
 
 
10
  # --- Basic Agent Definition ---
11
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
12
-
13
-
14
  class BasicAgent:
15
  def __init__(self):
16
  print("BasicAgent initialized.")
@@ -23,7 +25,7 @@ class BasicAgent:
23
  self.tokenizer = AutoTokenizer.from_pretrained(self.model_name)
24
  self.model = AutoModelForCausalLM.from_pretrained(
25
  self.model_name,
26
- torch_dtype="auto",
27
  device_map="auto"
28
  )
29
  print(f"Successfully loaded {self.model_name}")
 
7
  import torch
8
  from transformers import AutoModelForCausalLM, AutoTokenizer
9
 
10
+ # (Keep Constants as is)
11
+ # --- Constants ---
12
+ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
13
+
14
  # --- Basic Agent Definition ---
15
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
 
 
16
  class BasicAgent:
17
  def __init__(self):
18
  print("BasicAgent initialized.")
 
25
  self.tokenizer = AutoTokenizer.from_pretrained(self.model_name)
26
  self.model = AutoModelForCausalLM.from_pretrained(
27
  self.model_name,
28
+ torch_dtype="auto",1
29
  device_map="auto"
30
  )
31
  print(f"Successfully loaded {self.model_name}")