keynes42 commited on
Commit
8d9fd6c
·
verified ·
1 Parent(s): 34722bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -4,6 +4,7 @@ import requests
4
  import inspect
5
  import pandas as pd
6
  from smolagents import CodeAgent, HfApiModel
 
7
 
8
  # (Keep Constants as is)
9
  # --- Constants ---
@@ -17,9 +18,16 @@ class BasicAgent:
17
 
18
  print("ENV-HF_TOKEN-LEN", len(os.getenv("HF_TOKEN", "")), file=sys.stderr)
19
 
 
 
 
 
 
 
 
20
  # Initialize the model
21
  model = HfApiModel(model_id="deepseek-ai/DeepSeek-V3-0324",
22
- # llm_format="text-generation",
23
  token=os.environ["HF_TOKEN"],
24
  max_tokens=2048,
25
  temperature=0.0
 
4
  import inspect
5
  import pandas as pd
6
  from smolagents import CodeAgent, HfApiModel
7
+ from huggingface_hub import InferenceClient, hf_hub_download
8
 
9
  # (Keep Constants as is)
10
  # --- Constants ---
 
18
 
19
  print("ENV-HF_TOKEN-LEN", len(os.getenv("HF_TOKEN", "")), file=sys.stderr)
20
 
21
+ # Local test
22
+ client = InferenceClient(
23
+ model="deepseek-ai/DeepSeek-V3-0324",
24
+ token=os.environ["HF_TOKEN"]
25
+ )
26
+ print(client.text_generation("Hello, my name is", max_new_tokens=20))
27
+
28
  # Initialize the model
29
  model = HfApiModel(model_id="deepseek-ai/DeepSeek-V3-0324",
30
+ format="text-generation",
31
  token=os.environ["HF_TOKEN"],
32
  max_tokens=2048,
33
  temperature=0.0