DevStudio-AI commited on
Commit
17f7200
·
verified ·
1 Parent(s): 68923cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -6,20 +6,18 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
6
  import spaces # Mandatory library for Hugging Face ZeroGPU [1]
7
 
8
  MODEL_ID = "DevStudio-AI/Devstudio-Coder-1.5B"
9
-
10
  # Fetch your secure token from the Space Secrets environment
11
  HF_TOKEN = os.environ.get("HF_TOKEN")
12
 
13
  print("Loading tokenizer and base model...")
14
 
15
- # Pass the token parameter and force use_fast=False to bypass the tokenizer.json loading bug [1.3.1]
 
16
  tokenizer = AutoTokenizer.from_pretrained(
17
- MODEL_ID,
18
- token=HF_TOKEN,
19
- use_fast=False
20
  )
21
 
22
- # We load the model in 16-bit on CPU first
23
  # ZeroGPU will automatically move the model to the GPU when the decorated function runs [1]
24
  model = AutoModelForCausalLM.from_pretrained(
25
  MODEL_ID,
 
6
  import spaces # Mandatory library for Hugging Face ZeroGPU [1]
7
 
8
  MODEL_ID = "DevStudio-AI/Devstudio-Coder-1.5B"
 
9
  # Fetch your secure token from the Space Secrets environment
10
  HF_TOKEN = os.environ.get("HF_TOKEN")
11
 
12
  print("Loading tokenizer and base model...")
13
 
14
+ # 1. Load the tokenizer from the official, guaranteed-clean Qwen repository
15
+ # This bypasses any local repository file corruption or cache issues
16
  tokenizer = AutoTokenizer.from_pretrained(
17
+ "Qwen/Qwen2.5-Coder-1.5B-Instruct"
 
 
18
  )
19
 
20
+ # 2. We load your custom model in 16-bit on CPU first
21
  # ZeroGPU will automatically move the model to the GPU when the decorated function runs [1]
22
  model = AutoModelForCausalLM.from_pretrained(
23
  MODEL_ID,