Sam-Orion commited on
Commit
3abf791
·
1 Parent(s): ad30dd5

Indus 3.0 Demo

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -36,6 +36,15 @@ if os.path.exists(config_path):
36
  else:
37
  print(f"\nconfig.json not found at {config_path}")
38
 
 
 
 
 
 
 
 
 
 
39
  # Load from the extracted folder
40
  tokenizer = AutoTokenizer.from_pretrained(extract_dir)
41
  model = AutoModelForCausalLM.from_pretrained(extract_dir, torch_dtype="auto", device_map="auto")
 
36
  else:
37
  print(f"\nconfig.json not found at {config_path}")
38
 
39
+ model_path = None
40
+ for root, dirs, files in os.walk(base_dir):
41
+ if "config.json" in files:
42
+ model_path = root
43
+ break
44
+
45
+ if model_path is None:
46
+ raise FileNotFoundError("config.json not found after extraction")
47
+
48
  # Load from the extracted folder
49
  tokenizer = AutoTokenizer.from_pretrained(extract_dir)
50
  model = AutoModelForCausalLM.from_pretrained(extract_dir, torch_dtype="auto", device_map="auto")